hosts/caramel, users/hana: init

This commit is contained in:
LavaDesu 2022-02-02 00:50:39 +07:00
parent 41c4362136
commit 1f8b0bd54c
Signed by: cilly
GPG key ID: 6500251E087653C9
14 changed files with 246 additions and 46 deletions

26
hosts/caramel/default.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, inputs, modules, overlays, pkgs, ... }: {
networking.hostName = "caramel";
system.stateVersion = "21.11";
time.timeZone = "Asia/Phnom_Penh";
age.secrets = {
passwd.file = ../../secrets/passwd.age;
wpa_conf.file = ../../secrets/wpa_conf.age;
};
imports = with modules.system; [
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,28 @@
{ 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" ];
};
"/nix" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "defaults" "noatime" ];
};
"/var/persist" = bind "/nix/persist";
"/var/log/journal" = bind "/nix/persist/journal";
"/boot" = bind "/nix/persist/boot";
};
}

11
hosts/caramel/kernel.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, inputs, pkgs, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
];
hardware.raspberry-pi."4".fkms-3d.enable = true;
boot.kernel.sysctl = {
"kernel.core_pattern" = "|/bin/false";
"kernel.sysrq" = 1;
};
}

View file

@ -0,0 +1,28 @@
{ config, ... }: {
environment.etc."wpa_supplicant.conf".source = config.age.secrets.wpa_conf.path;
networking = {
wireless = {
enable = true;
interfaces = [ "wlan0" ];
};
useDHCP = false;
interfaces.wlan0.useDHCP = false;
interfaces.wlan0.ipv4.addresses = [{
address = "192.168.100.15";
prefixLength = 24;
}];
defaultGateway = "192.168.100.1";
nameservers = [ "8.8.8.8" ];
extraHosts = ''
192.168.100.10 strawberry
192.168.100.11 peach
192.168.100.12 butterfly
192.168.100.13 winter
192.168.100.13 blossom
192.168.100.14 apricot
'';
};
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
git
htop
jq
neovim
rsync
sshfs
wget
];
environment.variables.EDITOR = "nvim";
}