hosts/dandelion: init
This commit is contained in:
parent
a1510113a5
commit
d13a8e5cd4
7 changed files with 107 additions and 3 deletions
24
hosts/dandelion/default.nix
Normal file
24
hosts/dandelion/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, inputs, modules, modulesPath, overlays, pkgs, ... }: {
|
||||
networking.hostName = "dandelion";
|
||||
system.stateVersion = "23.11";
|
||||
time.timeZone = "Australia/Melbourne";
|
||||
|
||||
imports = with modules.system; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
inputs.home-manager-stable.nixosModule
|
||||
|
||||
base
|
||||
home-manager
|
||||
input
|
||||
nix-stable
|
||||
security
|
||||
#wireguard
|
||||
|
||||
./filesystem.nix
|
||||
./kernel.nix
|
||||
./networking.nix
|
||||
./packages.nix
|
||||
|
||||
../../users/hana
|
||||
];
|
||||
}
|
||||
34
hosts/dandelion/filesystem.nix
Normal file
34
hosts/dandelion/filesystem.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
bind = src: {
|
||||
depends = [ "/nix" ];
|
||||
device = src;
|
||||
fsType = "none";
|
||||
neededForBoot = true;
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
mkLabelMount = label: type: lazy: {
|
||||
device = "/dev/disk/by-label/${label}";
|
||||
fsType = type;
|
||||
options = [ "defaults" "relatime" ] ++ lib.optionals lazy [ "nofail" ];
|
||||
};
|
||||
mkBtrfsMount = name: subvol: atime: mkLabelMount name "btrfs" false // {
|
||||
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ];
|
||||
};
|
||||
submount = mkBtrfsMount "DANDELION";
|
||||
in {
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "rootfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "defaults" "size=12G" "mode=755" ];
|
||||
};
|
||||
|
||||
"/boot" = mkLabelMount "UEFI" "vfat" true;
|
||||
"/nix" = submount "/@/nix" false;
|
||||
"/persist" = (submount "/@/persist" true) // { neededForBoot = true; };
|
||||
"/persist/.snapshots" = submount "/snap/persist" false;
|
||||
"/var/log/journal" = bind "/persist/journal";
|
||||
};
|
||||
}
|
||||
18
hosts/dandelion/kernel.nix
Normal file
18
hosts/dandelion/kernel.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, inputs, pkgs, ... }: {
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "/dev/sda";
|
||||
};
|
||||
};
|
||||
initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
|
||||
initrd.kernelModules = [ "nvme" ];
|
||||
kernel.sysctl = {
|
||||
"kernel.core_pattern" = "|/bin/false";
|
||||
"kernel.sysrq" = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
10
hosts/dandelion/networking.nix
Normal file
10
hosts/dandelion/networking.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, ... }: {
|
||||
networking = {
|
||||
useDHCP = true;
|
||||
|
||||
# extraHosts = ''
|
||||
# 10.100.0.3 blossom
|
||||
# 10.100.0.4 strawberry
|
||||
# '';
|
||||
};
|
||||
}
|
||||
14
hosts/dandelion/packages.nix
Normal file
14
hosts/dandelion/packages.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
htop
|
||||
jq
|
||||
neovim
|
||||
rsync
|
||||
sshfs
|
||||
wget
|
||||
|
||||
kitty.terminfo
|
||||
];
|
||||
environment.variables.EDITOR = "nvim";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue