summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-28 09:33:13 -0700
committerFuwn <[email protected]>2024-10-28 09:33:13 -0700
commitca3140e7c1ddea7826a96742f3285a2ea2e4be9d (patch)
tree3534f105c278821315d5e6c7604db471921f0f7f /hosts
parentcore: allow mosh as optional (diff)
downloadnixos-config-ca3140e7c1ddea7826a96742f3285a2ea2e4be9d.tar.xz
nixos-config-ca3140e7c1ddea7826a96742f3285a2ea2e4be9d.zip
kioku: add core modules
Diffstat (limited to 'hosts')
-rw-r--r--hosts/default.nix2
-rw-r--r--hosts/kioku/configuration.nix167
-rw-r--r--hosts/kioku/default.nix3
3 files changed, 89 insertions, 83 deletions
diff --git a/hosts/default.nix b/hosts/default.nix
index 49546fc..f683ce3 100644
--- a/hosts/default.nix
+++ b/hosts/default.nix
@@ -43,6 +43,6 @@
(import ./akashi pcInherits)
(import ./himeji (commonInherits // { inherit commonModules; }))
(import ./kansai pcInherits)
- (import ./kioku commonInherits)
+ (import ./kioku (commonInherits // { inherit commonModules; }))
];
}
diff --git a/hosts/kioku/configuration.nix b/hosts/kioku/configuration.nix
index 6dec934..8e49bd6 100644
--- a/hosts/kioku/configuration.nix
+++ b/hosts/kioku/configuration.nix
@@ -2,111 +2,116 @@
lib,
pkgs,
secrets,
+ self,
...
}:
let
primaryUser = "ebisu";
in
{
- time.timeZone = secrets.i18n.timezone;
- system.stateVersion = "24.05";
- raspberry-pi-nix.kernel-version = "v6_10_12";
-
- environment.systemPackages = with pkgs; [
- fastfetch
- htop
+ imports = [
+ "${self}/modules/core"
+ "${self}/modules/options"
];
- users = {
- groups.${primaryUser} = { };
+ config = {
+ modules.nix.extend = false;
+ time.timeZone = secrets.i18n.timezone;
+ system.stateVersion = "24.05";
+ raspberry-pi-nix.kernel-version = "v6_10_12";
- users =
- let
- defaultOptions = {
- initialHashedPassword = secrets.initial_hashed_password;
- openssh.authorizedKeys.keys = [ secrets.kioku_openssh_public_key ];
- };
- in
- {
- root = defaultOptions;
+ environment.systemPackages = with pkgs; [
+ fastfetch
+ htop
+ ];
- ${primaryUser} = defaultOptions // {
- group = primaryUser;
- isNormalUser = true;
- };
- };
- };
+ users = {
+ groups.${primaryUser} = { };
- zramSwap = {
- enable = true;
- priority = 100;
- memoryMax = 268435456;
- algorithm = "lz4";
- memoryPercent = 50;
- };
+ users =
+ let
+ defaultOptions = {
+ initialHashedPassword = secrets.initial_hashed_password;
+ openssh.authorizedKeys.keys = [ secrets.kioku_openssh_public_key ];
+ };
+ in
+ {
+ root = defaultOptions;
- networking = {
- hostName = "kioku";
- useDHCP = lib.mkDefault true;
+ ${primaryUser} = defaultOptions // {
+ group = primaryUser;
+ isNormalUser = true;
+ };
+ };
+ };
- wireless =
- let
- network = builtins.elemAt secrets.wifi 0;
- in
- {
- enable = true;
- interfaces = [ "wlan0" ];
- networks."${network.ssid}".psk = network.psk;
- };
- };
+ zramSwap = {
+ enable = true;
+ priority = 100;
+ memoryMax = 268435456;
+ algorithm = "lz4";
+ memoryPercent = 50;
+ };
- services = {
- timesyncd.enable = true;
+ networking = {
+ firewall.enable = lib.mkForce false;
+ hostName = "kioku";
+ useDHCP = lib.mkDefault true;
- openssh = {
- enable = true;
- settings.PermitRootLogin = "prohibit-password";
+ wireless =
+ let
+ network = builtins.elemAt secrets.wifi 0;
+ in
+ {
+ enable = true;
+ interfaces = [ "wlan0" ];
+ networks."${network.ssid}".psk = network.psk;
+ };
};
- samba = {
- enable = true;
- openFirewall = true;
+ services = {
+ openssh.settings.PermitRootLogin = "prohibit-password";
- settings = {
- usb = {
- browseable = "yes";
- path = "/mnt/usb_share";
- "guest ok" = "no";
- "read only" = "no";
- "create mask" = "777";
- "directory mask" = "777";
- "valid users" = primaryUser;
+ samba = {
+ enable = true;
+ openFirewall = true;
+
+ settings = {
+ usb = {
+ browseable = "yes";
+ path = "/mnt/usb_share";
+ "guest ok" = "no";
+ "read only" = "no";
+ "create mask" = "777";
+ "directory mask" = "777";
+ "valid users" = primaryUser;
+ };
};
};
- };
- samba-wsdd = {
- enable = true;
- openFirewall = true;
+ samba-wsdd = {
+ enable = true;
+ openFirewall = true;
+ };
};
- };
- systemd.services.usbshare = {
- description = "USB Share Watchdog";
- wantedBy = [ "multi-user.target" ];
+ systemd.services.usbshare = {
+ description = "USB Share Watchdog";
+ wantedBy = [ "multi-user.target" ];
- serviceConfig =
- let
- usb_share_script = pkgs.fetchurl {
- url = "https://gist.githubusercontent.com/davidhoness/0f45ef6a41bac6311614f109acbf92db/raw/970badd0ae4b097e3af8d5142e65c34b21f5cfab/usb_share.py";
- sha256 = "sha256-Z8HoOmzK3UjZac6hB3297fCDrbLwiFFNwxhqzr1WMSo";
+ serviceConfig =
+ let
+ usb_share_script = pkgs.fetchurl {
+ url = "https://gist.githubusercontent.com/davidhoness/0f45ef6a41bac6311614f109acbf92db/raw/970badd0ae4b097e3af8d5142e65c34b21f5cfab/usb_share.py";
+ sha256 = "sha256-Z8HoOmzK3UjZac6hB3297fCDrbLwiFFNwxhqzr1WMSo";
+ };
+ in
+ {
+ ExecStart = "${pkgs.python3.withPackages (ps: [ ps.watchdog ])}/bin/python3 ${usb_share_script}";
+ Restart = "always";
+ Type = "simple";
+ Environment = "PATH=${pkgs.kmod}/bin:${pkgs.coreutils}/bin";
};
- in
- {
- ExecStart = "${pkgs.python3.withPackages (ps: [ ps.watchdog ])}/bin/python3 ${usb_share_script}";
- Restart = "always";
- Type = "simple";
- Environment = "PATH=${pkgs.kmod}/bin:${pkgs.coreutils}/bin";
- };
+ };
};
}
diff --git a/hosts/kioku/default.nix b/hosts/kioku/default.nix
index 1e37f68..714f6ad 100644
--- a/hosts/kioku/default.nix
+++ b/hosts/kioku/default.nix
@@ -5,6 +5,7 @@
self,
kansaiPkgs,
lib,
+ commonModules,
}:
{
flake.nixosConfigurations.kioku = lib.nixosSystem {
@@ -18,7 +19,7 @@
inputs.raspberry-pi-nix.nixosModules.raspberry-pi
./configuration.nix
./hardware-configuration.nix
- ];
+ ] ++ commonModules;
specialArgs = {
inherit