hosts/hazel: init

This commit is contained in:
LavaDesu 2025-04-05 13:05:59 +11:00
parent 3502a31065
commit 4d751d72b3
Signed by: cilly
GPG key ID: 6500251E087653C9
8 changed files with 121 additions and 8 deletions

View file

@ -2,15 +2,19 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
agenix.url = "github:ryantm/agenix";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
aagl.url = "github:ezKEa/aagl-gtk-on-nix";
nixpkgs-vicuna.url = "github:NixOS/nixpkgs/release-24.11";
home-manager-vicuna.url = "github:nix-community/home-manager/release-24.11";
home-manager-vicuna.inputs.nixpkgs.follows = "nixpkgs-vicuna";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
aagl.url = "github:ezKEa/aagl-gtk-on-nix";
catppuccin.url = "github:catppuccin/nix/8eada392fd6571a747e1c5fc358dd61c14c8704e";
catppuccin.inputs.nixpkgs.follows = "nixpkgs";
catppuccin-palette = { url = "github:catppuccin/palette"; flake = false; };
home-manager.inputs.nixpkgs.follows = "nixpkgs";
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
neovim-nightly.inputs.nixpkgs.follows = "nixpkgs";
nix-gaming.url = "github:fufexan/nix-gaming";
@ -35,7 +39,7 @@
wine-discord-ipc-bridge = { url = "github:0e4ef622/wine-discord-ipc-bridge"; flake = false; };
};
outputs = { self, agenix, catppuccin, nixpkgs, ... } @ inputs:
outputs = { self, agenix, catppuccin, nixpkgs, nixpkgs-vicuna, ... } @ inputs:
let
overlays = (import ./overlays)
++ [(final: prev: {
@ -69,6 +73,7 @@
in
{
nixosConfigurations."anemone" = mkSystem nixpkgs "anemone" "x86_64-linux" [];
nixosConfigurations."hazel" = mkSystem nixpkgs-vicuna "hazel" "x86_64-linux" [];
nixosConfigurations."hyacinth" = mkSystem nixpkgs "hyacinth" "x86_64-linux" [];
packages."x86_64-linux" =

22
hosts/hazel/default.nix Normal file
View file

@ -0,0 +1,22 @@
{ modules, ... }: {
networking.hostName = "hazel";
system.stateVersion = "24.11";
time.timeZone = "Australia/Melbourne";
imports = with modules.system; [
home-manager
base
kernel
nix-stable
packages
security
./filesystem.nix
./kernel.nix
./networking.nix
./packages.nix
../../users/hana
];
}

View file

@ -0,0 +1,53 @@
{ ... }:
let
mkLabelMount = label: type: options: {
device = "/dev/disk/by-label/${label}";
fsType = type;
options = options;
};
mkBtrfsMount = name: ext: subvol: atime: mkLabelMount name "btrfs"
[
"autodefrag"
"compress=zstd:4"
"compress-force=zstd:4"
"defaults"
"nossd"
"space_cache=v2"
"subvol=${subvol}"
(if atime then "relatime" else "noatime")
] ++ ext;
mkHazelMount = mkBtrfsMount "HAZEL" [ "noauto" ];
in
{
boot.supportedFilesystems = [ "btrfs" ];
fileSystems = {
"/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "mode=755" ];
};
"/boot" = mkLabelMount "ROOT" "vfat" [];
"/flower" = mkHazelMount "/current/flower" true;
"/persist" = mkHazelMount "/current/persist" true;
"/var" = mkHazelMount "/current/var" true;
"/nix" = mkHazelMount "/current/nix" false;
"/mnt" = mkHazelMount "/" true;
};
services.snapper.cleanupInterval = "1h";
services.snapper.configs.flower = {
FSTYPE = "btrfs";
SUBVOLUME = "/mnt/current/flower";
TIMELINE_CLEANUP = true;
TIMELINE_CREATE = true;
TIMELINE_MIN_AGE = "1800";
TIMELINE_LIMIT_HOURLY = "5";
TIMELINE_LIMIT_DAILY = "7";
TIMELINE_LIMIT_WEEKLY = "0";
TIMELINE_LIMIT_MONTHLY = "0";
TIMELINE_LIMIT_YEARLY = "0";
};
}

View file

10
hosts/hazel/kernel.nix Normal file
View file

@ -0,0 +1,10 @@
{ ... }: {
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ "kvm-amd" ];
};
}

View file

@ -0,0 +1,5 @@
{ config, ... }: {
networking = {
useDHCP = true;
};
}

View file

@ -0,0 +1,19 @@
{ config, inputs, modules, ... }: {
imports = [
inputs.home-manager-vicuna.nixosModules.home-manager
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs modules;
sysConfig = config;
};
sharedModules = [
{
imports = [ modules.options ];
config.me = config.me;
}
];
};
}

View file

@ -7,8 +7,7 @@
uid = 1002;
hashedPassword = "$y$j9T$3xCNDudmfrIu5VfQQoDkj/$ugzJWq0gORN9jnhDsREu31CkL3zwniQu6KoLbmg6Wr/";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPru5eTBvHJ4ZmrrzPRHCGM09wQP/ZHSaKYalDuBVO15 rin@blossom"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ5l9t8dc6mPsKKYqZlPKvhOdyqz+DS5UOcvHuh3uVGt @strawberry"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPru5eTBvHJ4ZmrrzPRHCGM09wQP/ZHSaKYalDuBVO15 rin@anemone"
];
};
@ -16,7 +15,7 @@
home = {
username = "hana";
homeDirectory = "/home/hana";
stateVersion = "23.11";
stateVersion = "24.11";
};
imports = with modules.user; [