hosts/sugarcane: init
This commit is contained in:
parent
9057a029ab
commit
8733fc7054
12 changed files with 124 additions and 21 deletions
26
hosts/sugarcane/default.nix
Normal file
26
hosts/sugarcane/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, inputs, modules, modulesPath, overlays, pkgs, ... }: {
|
||||
networking.hostName = "sugarcane";
|
||||
system.stateVersion = "21.11";
|
||||
time.timeZone = "Asia/Singapore";
|
||||
|
||||
age.secrets = {
|
||||
passwd.file = ../../secrets/passwd.age;
|
||||
};
|
||||
imports = with modules.system; [
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
inputs.home-manager-porcupine.nixosModule
|
||||
|
||||
base
|
||||
home-manager
|
||||
input
|
||||
nix
|
||||
security
|
||||
|
||||
./filesystem.nix
|
||||
./kernel.nix
|
||||
./networking.nix
|
||||
./packages.nix
|
||||
|
||||
../../users/hana
|
||||
];
|
||||
}
|
||||
37
hosts/sugarcane/filesystem.nix
Normal file
37
hosts/sugarcane/filesystem.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
bind = src: {
|
||||
depends = [ "/nix" ];
|
||||
device = src;
|
||||
fsType = "none";
|
||||
neededForBoot = true;
|
||||
options = [ "bind" ];
|
||||
};
|
||||
in {
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "rootfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "defaults" "size=2G" "mode=755" ];
|
||||
};
|
||||
|
||||
"/mnt" = {
|
||||
device = "/dev/disk/by-uuid/19d572a8-1cf6-4b9c-94c6-3ce6be54f719";
|
||||
fsType = "ext4";
|
||||
options = [ "defaults" "noatime" ];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
depends = [ "/mnt" ];
|
||||
device = "/mnt/nix";
|
||||
fsType = "none";
|
||||
neededForBoot = true;
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
"/var/persist" = bind "/nix/persist";
|
||||
"/var/log/journal" = bind "/nix/persist/journal";
|
||||
"/boot" = bind "/nix/persist/boot";
|
||||
};
|
||||
}
|
||||
17
hosts/sugarcane/kernel.nix
Normal file
17
hosts/sugarcane/kernel.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ config, inputs, pkgs, ... }: {
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "/dev/sda";
|
||||
};
|
||||
};
|
||||
initrd.kernelModules = [ "nvme" ];
|
||||
kernel.sysctl = {
|
||||
"kernel.core_pattern" = "|/bin/false";
|
||||
"kernel.sysrq" = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
6
hosts/sugarcane/networking.nix
Normal file
6
hosts/sugarcane/networking.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, ... }: {
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
interfaces.ens3.useDHCP = true;
|
||||
};
|
||||
}
|
||||
15
hosts/sugarcane/packages.nix
Normal file
15
hosts/sugarcane/packages.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
htop
|
||||
jq
|
||||
neovim
|
||||
rsync
|
||||
sshfs
|
||||
wget
|
||||
|
||||
kitty.terminfo
|
||||
];
|
||||
environment.variables.EDITOR = "nvim";
|
||||
nix.package = lib.mkForce pkgs.nix_2_4;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue