hosts/sugarcane: init

This commit is contained in:
LavaDesu 2022-02-02 16:05:17 +07:00
parent 9057a029ab
commit 8733fc7054
Signed by: cilly
GPG key ID: 6500251E087653C9
12 changed files with 124 additions and 21 deletions

View 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
];
}

View 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";
};
}

View 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;
};
};
}

View file

@ -0,0 +1,6 @@
{ config, ... }: {
networking = {
useDHCP = false;
interfaces.ens3.useDHCP = true;
};
}

View 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;
}