HASH 41dd77eb3484
DATE 2025-03-01
SUBJECT guest: initial guest config
FILES 7 CHANGED
HASH 41dd77eb3484
DATE 2025-03-01
SUBJECT guest: initial guest config
FILES 7 CHANGED
┌─ hosts/ooksx1/default.nix ─────────────────────────────────────────────────┐
│ diff --git a/hosts/ooksx1/default.nix b/hosts/ooksx1/default.nix │
│ new file mode 100644 │
│ index 0000000..72b4b37 │
│ --- /dev/null │
│ +++ b/hosts/ooksx1/default.nix │
│ @@ -0,0 +1,43 @@ │
│ +{ │
│ + lib, │
│ + pkgs, │
│ + ... │
│ +}: { │
│ + imports = [ │
│ + ./file-system.nix │
│ + ./hardware.nix │
│ + ]; │
│ + │
│ + ooknet = { │
│ + host = { │
│ + admin = { │
│ + name = "ooks"; │
│ + shell = "fish"; │
│ + homeManager = false; │
│ + }; │
│ + guest = { │
│ + enable = true; │
│ + name = "eureka"; │
│ + homeManager = true; │
│ + shell = "fish"; │
│ + }; │
│ + }; │
│ + workstation = { │
│ + environment = "gnome"; │
│ + theme = "minimal"; │
│ + profiles = ["media" "communication" "productivity"]; │
│ + default = { │
│ + browser = "chrome"; │
│ + terminal = "ghostty"; │
│ + }; │
│ + }; │
│ + console = { │
│ + profile = "standard"; │
│ + editor = "nvim"; │
│ + multiplexer = "zellij"; │
│ + }; │
│ + }; │
│ + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; │
│ + │
│ + system.stateVersion = lib.mkDefault "24.11"; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ hosts/ooksx1/default.nix ───────────┐
│ diff --git a/hosts/ooksx1/default.nix b/host │
│ s/ooksx1/default.nix │
│ new file mode 100644 │
│ index 0000000..72b4b37 │
│ --- /dev/null │
│ +++ b/hosts/ooksx1/default.nix │
│ @@ -0,0 +1,43 @@ │
│ +{ │
│ + lib, │
│ + pkgs, │
│ + ... │
│ +}: { │
│ + imports = [ │
│ + ./file-system.nix │
│ + ./hardware.nix │
│ + ]; │
│ + │
│ + ooknet = { │
│ + host = { │
│ + admin = { │
│ + name = "ooks"; │
│ + shell = "fish"; │
│ + homeManager = false; │
│ + }; │
│ + guest = { │
│ + enable = true; │
│ + name = "eureka"; │
│ + homeManager = true; │
│ + shell = "fish"; │
│ + }; │
│ + }; │
│ + workstation = { │
│ + environment = "gnome"; │
│ + theme = "minimal"; │
│ + profiles = ["media" "communication" " │
│ productivity"]; │
│ + default = { │
│ + browser = "chrome"; │
│ + terminal = "ghostty"; │
│ + }; │
│ + }; │
│ + console = { │
│ + profile = "standard"; │
│ + editor = "nvim"; │
│ + multiplexer = "zellij"; │
│ + }; │
│ + }; │
│ + boot.kernelPackages = pkgs.linuxPackages_ │
│ xanmod_latest; │
│ + │
│ + system.stateVersion = lib.mkDefault "24.1 │
│ 1"; │
│ +} │
└──────────────────────────────────────────────┘
┌─ hosts/ooksx1/file-system.nix ─────────────────────────────────────────────┐
│ diff --git a/hosts/ooksx1/file-system.nix b/hosts/ooksx1/file-system.nix │
│ new file mode 100644 │
│ index 0000000..af8d795 │
│ --- /dev/null │
│ +++ b/hosts/ooksx1/file-system.nix │
│ @@ -0,0 +1,39 @@ │
│ +{ │
│ + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/b5d09a8b-54a9- │
│ 4f72-828c-5cceea2ec287"; │
│ + fileSystems = { │
│ + "/" = { │
│ + device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=root"]; │
│ + }; │
│ + │
│ + "/nix" = { │
│ + device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=nix"]; │
│ + }; │
│ + │
│ + "/persist" = { │
│ + device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=persist"]; │
│ + }; │
│ + │
│ + "/swap" = { │
│ + device = "/dev/disk/by-uuid/629a7421-24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=swap"]; │
│ + }; │
│ + │
│ + "/boot" = { │
│ + device = "/dev/disk/by-uuid/1D01-7040"; │
│ + fsType = "vfat"; │
│ + }; │
│ + }; │
│ + swapDevices = [ │
│ + { │
│ + device = "/swap/swapfile"; │
│ + size = 8 * 1024; │
│ + } │
│ + ]; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ hosts/ooksx1/file-system.nix ───────┐
│ diff --git a/hosts/ooksx1/file-system.nix b/ │
│ hosts/ooksx1/file-system.nix │
│ new file mode 100644 │
│ index 0000000..af8d795 │
│ --- /dev/null │
│ +++ b/hosts/ooksx1/file-system.nix │
│ @@ -0,0 +1,39 @@ │
│ +{ │
│ + boot.initrd.luks.devices."cryptroot".devi │
│ ce = "/dev/disk/by-uuid/b5d09a8b-54a9-4f72-8 │
│ 28c-5cceea2ec287"; │
│ + fileSystems = { │
│ + "/" = { │
│ + device = "/dev/disk/by-uuid/629a7421- │
│ 24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=root"]; │
│ + }; │
│ + │
│ + "/nix" = { │
│ + device = "/dev/disk/by-uuid/629a7421- │
│ 24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=nix"]; │
│ + }; │
│ + │
│ + "/persist" = { │
│ + device = "/dev/disk/by-uuid/629a7421- │
│ 24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=persist"]; │
│ + }; │
│ + │
│ + "/swap" = { │
│ + device = "/dev/disk/by-uuid/629a7421- │
│ 24a0-45e6-87af-031574d9d46d"; │
│ + fsType = "btrfs"; │
│ + options = ["subvol=swap"]; │
│ + }; │
│ + │
│ + "/boot" = { │
│ + device = "/dev/disk/by-uuid/1D01-7040 │
│ "; │
│ + fsType = "vfat"; │
│ + }; │
│ + }; │
│ + swapDevices = [ │
│ + { │
│ + device = "/swap/swapfile"; │
│ + size = 8 * 1024; │
│ + } │
│ + ]; │
│ +} │
└──────────────────────────────────────────────┘
┌─ hosts/ooksx1/hardware.nix ────────────────────────────────────────────────┐
│ diff --git a/hosts/ooksx1/hardware.nix b/hosts/ooksx1/hardware.nix │
│ new file mode 100644 │
│ index 0000000..64fa886 │
│ --- /dev/null │
│ +++ b/hosts/ooksx1/hardware.nix │
│ @@ -0,0 +1,33 @@ │
│ +{ │
│ + ooknet.hardware = { │
│ + cpu = { │
│ + type = "amd"; │
│ + amd.pstate.enable = true; │
│ + cores = 16; │
│ + }; │
│ + gpu = { │
│ + type = "amd"; │
│ + lact.enable = true; │
│ + }; │
│ + features = ["printing" "ssd" "audio" "video"]; │
│ + monitors = [ │
│ + { │
│ + name = "DP-1"; │
│ + primary = true; │
│ + width = 2560; │
│ + height = 1440; │
│ + refreshRate = 144; │
│ + x = 1920; │
│ + y = 100; │
│ + } │
│ + { │
│ + name = "DP-2"; │
│ + width = 1920; │
│ + height = 1080; │
│ + refreshRate = 180; │
│ + x = 840; │
│ + transform = 1; │
│ + } │
│ + ]; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ hosts/ooksx1/hardware.nix ──────────┐
│ diff --git a/hosts/ooksx1/hardware.nix b/hos │
│ ts/ooksx1/hardware.nix │
│ new file mode 100644 │
│ index 0000000..64fa886 │
│ --- /dev/null │
│ +++ b/hosts/ooksx1/hardware.nix │
│ @@ -0,0 +1,33 @@ │
│ +{ │
│ + ooknet.hardware = { │
│ + cpu = { │
│ + type = "amd"; │
│ + amd.pstate.enable = true; │
│ + cores = 16; │
│ + }; │
│ + gpu = { │
│ + type = "amd"; │
│ + lact.enable = true; │
│ + }; │
│ + features = ["printing" "ssd" "audio" "v │
│ ideo"]; │
│ + monitors = [ │
│ + { │
│ + name = "DP-1"; │
│ + primary = true; │
│ + width = 2560; │
│ + height = 1440; │
│ + refreshRate = 144; │
│ + x = 1920; │
│ + y = 100; │
│ + } │
│ + { │
│ + name = "DP-2"; │
│ + width = 1920; │
│ + height = 1080; │
│ + refreshRate = 180; │
│ + x = 840; │
│ + transform = 1; │
│ + } │
│ + ]; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ modules/home/workstation/browser/chromium/default.nix ────────────────────┐
│ diff --git a/modules/home/workstation/browser/chromium/default.nix b/modules/home/ │
│ workstation/browser/chromium/default.nix │
│ new file mode 100644 │
│ index 0000000..988c516 │
│ --- /dev/null │
│ +++ b/modules/home/workstation/browser/chromium/default.nix │
│ @@ -0,0 +1,21 @@ │
│ +{ │
│ + lib, │
│ + osConfig, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf mkMerge; │
│ + inherit (osConfig.ooknet.workstation) default; │
│ + cfg = osConfig.ooknet.workstation.programs.chromium; │
│ +in { │
│ + config = mkMerge [ │
│ + (mkIf (cfg.enable || default.browser == "chromium") { │
│ + programs.chromium = { │
│ + enable = true; │
│ + }; │
│ + }) │
│ + (mkIf default.browser │
│ + == "chromium" { │
│ + home.sessionVariables.BROWSER = "chromium"; │
│ + }) │
│ + ]; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ .../browser/chromium/default.nix ───┐
│ diff --git a/modules/home/workstation/browse │
│ r/chromium/default.nix b/modules/home/workst │
│ ation/browser/chromium/default.nix │
│ new file mode 100644 │
│ index 0000000..988c516 │
│ --- /dev/null │
│ +++ b/modules/home/workstation/browser/chrom │
│ ium/default.nix │
│ @@ -0,0 +1,21 @@ │
│ +{ │
│ + lib, │
│ + osConfig, │
│ + ... │
│ +}: let │
│ + inherit (lib) mkIf mkMerge; │
│ + inherit (osConfig.ooknet.workstation) def │
│ ault; │
│ + cfg = osConfig.ooknet.workstation.program │
│ s.chromium; │
│ +in { │
│ + config = mkMerge [ │
│ + (mkIf (cfg.enable || default.browser == │
│ "chromium") { │
│ + programs.chromium = { │
│ + enable = true; │
│ + }; │
│ + }) │
│ + (mkIf default.browser │
│ + == "chromium" { │
│ + home.sessionVariables.BROWSER = "ch │
│ romium"; │
│ + }) │
│ + ]; │
│ +} │
└──────────────────────────────────────────────┘
┌─ modules/nixos/base/guest.nix ─────────────────────────────────────────────┐
│ diff --git a/modules/nixos/base/guest.nix b/modules/nixos/base/guest.nix │
│ new file mode 100644 │
│ index 0000000..be22d94 │
│ --- /dev/null │
│ +++ b/modules/nixos/base/guest.nix │
│ @@ -0,0 +1,30 @@ │
│ +{ │
│ + config, │
│ + pkgs, │
│ + ... │
│ +}: let │
│ + inherit (config.ooknet.host) guest; │
│ + inherit (config.ooknet.secrets) keys; │
│ + │
│ + ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.use │
│ rs.groups) groups; │
│ +in { │
│ + config = { │
│ + users.users.${guest.name} = { │
│ + isNormalUser = true; │
│ + shell = pkgs.${guest.shell}; │
│ + initialHashedPassword = "$y$j9T$l4Wje1zgcrPIM5G4BRAT6.$AKHmE2MvJLLiipYnwGsl │
│ jxbD0QmqYtHGlKht0kLLI87"; │
│ + openssh.authorizedKeys.keys = [keys.users."${guest.name}"]; │
│ + createHome = true; │
│ + home = "/home/${guest.name}"; │
│ + extraGroups = │
│ + [ │
│ + "video" │
│ + "audio" │
│ + ] │
│ + ++ ifTheyExist [ │
│ + "media" │
│ + "network" │
│ + ]; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ modules/nixos/base/guest.nix ───────┐
│ diff --git a/modules/nixos/base/guest.nix b/ │
│ modules/nixos/base/guest.nix │
│ new file mode 100644 │
│ index 0000000..be22d94 │
│ --- /dev/null │
│ +++ b/modules/nixos/base/guest.nix │
│ @@ -0,0 +1,30 @@ │
│ +{ │
│ + config, │
│ + pkgs, │
│ + ... │
│ +}: let │
│ + inherit (config.ooknet.host) guest; │
│ + inherit (config.ooknet.secrets) keys; │
│ + │
│ + ifTheyExist = groups: builtins.filter (gr │
│ oup: builtins.hasAttr group config.users.gro │
│ ups) groups; │
│ +in { │
│ + config = { │
│ + users.users.${guest.name} = { │
│ + isNormalUser = true; │
│ + shell = pkgs.${guest.shell}; │
│ + initialHashedPassword = "$y$j9T$l4Wje │
│ 1zgcrPIM5G4BRAT6.$AKHmE2MvJLLiipYnwGsljxbD0Q │
│ mqYtHGlKht0kLLI87"; │
│ + openssh.authorizedKeys.keys = [keys.u │
│ sers."${guest.name}"]; │
│ + createHome = true; │
│ + home = "/home/${guest.name}"; │
│ + extraGroups = │
│ + [ │
│ + "video" │
│ + "audio" │
│ + ] │
│ + ++ ifTheyExist [ │
│ + "media" │
│ + "network" │
│ + ]; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ modules/nixos/base/home-manager.nix ──────────────────────────────────────┐
│ diff --git a/modules/nixos/base/home-manager.nix b/modules/nixos/base/home-manager │
│ .nix │
│ index 29bb102..3162222 100644 │
│ --- a/modules/nixos/base/home-manager.nix │
│ +++ b/modules/nixos/base/home-manager.nix │
│ @@ -10,17 +10,22 @@ │
│ ... │
│ }: let │
│ inherit (lib) mkIf; │
│ - inherit (config.ooknet.host) admin; │
│ + inherit (config.ooknet.host) guest admin; │
│ in { │
│ - config = mkIf admin.homeManager { │
│ + config = mkIf (admin.homeManager || guest.homeManager) { │
│ home-manager = { │
│ useGlobalPkgs = true; │
│ useUserPackages = true; │
│ backupFileExtension = "hm.old"; │
│ verbose = true; │
│ extraSpecialArgs = {inherit ook hozen inputs inputs' self self';}; │
│ - users.${admin.name} = { │
│ - imports = ["${self}/modules/home/base"]; │
│ + users = { │
│ + ${admin.name} = mkIf admin.homeManager { │
│ + imports = ["${self}/modules/home/base"]; │
│ + }; │
│ + ${guest.name} = mkIf guest.homeManager { │
│ + imports = ["${self}/modules/home/base}"]; │
│ + }; │
│ }; │
│ }; │
│ }; │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...s/nixos/base/home-manager.nix ───┐
│ diff --git a/modules/nixos/base/home-manager │
│ .nix b/modules/nixos/base/home-manager.nix │
│ index 29bb102..3162222 100644 │
│ --- a/modules/nixos/base/home-manager.nix │
│ +++ b/modules/nixos/base/home-manager.nix │
│ @@ -10,17 +10,22 @@ │
│ ... │
│ }: let │
│ inherit (lib) mkIf; │
│ - inherit (config.ooknet.host) admin; │
│ + inherit (config.ooknet.host) guest admin; │
│ in { │
│ - config = mkIf admin.homeManager { │
│ + config = mkIf (admin.homeManager || guest │
│ .homeManager) { │
│ home-manager = { │
│ useGlobalPkgs = true; │
│ useUserPackages = true; │
│ backupFileExtension = "hm.old"; │
│ verbose = true; │
│ extraSpecialArgs = {inherit ook hozen │
│ inputs inputs' self self';}; │
│ - users.${admin.name} = { │
│ - imports = ["${self}/modules/home/ba │
│ se"]; │
│ + users = { │
│ + ${admin.name} = mkIf admin.homeMana │
│ ger { │
│ + imports = ["${self}/modules/home/ │
│ base"]; │
│ + }; │
│ + ${guest.name} = mkIf guest.homeMana │
│ ger { │
│ + imports = ["${self}/modules/home/ │
│ base}"]; │
│ + }; │
│ }; │
│ }; │
│ }; │
└──────────────────────────────────────────────┘
┌─ modules/nixos/base/options.nix ───────────────────────────────────────────┐
│ diff --git a/modules/nixos/base/options.nix b/modules/nixos/base/options.nix │
│ index ff3fcc6..59d430d 100644 │
│ --- a/modules/nixos/base/options.nix │
│ +++ b/modules/nixos/base/options.nix │
│ @@ -5,6 +5,30 @@ │
│ }: let │
│ inherit (lib) mkEnableOption mkOption; │
│ inherit (lib.types) str enum bool package; │
│ + │
│ + userOptions = { │
│ + name = mkOption { │
│ + type = str; │
│ + default = "ooks"; │
│ + }; │
│ + shell = mkOption { │
│ + type = enum ["bash" "zsh" "fish"]; │
│ + default = "fish"; │
│ + }; │
│ + email = mkOption { │
│ + type = str; │
│ + default = "[email protected]"; │
│ + }; │
│ + homeManager = mkOption { │
│ + type = bool; │
│ + default = false; │
│ + description = '' │
│ + Home-manager is enabled if ooknet.host.role == "workstation". │
│ + If host is not a workstation and you would like to enable home-manager │
│ + enable this option. │
│ + ''; │
│ + }; │
│ + }; │
│ in { │
│ options.ooknet.host = { │
│ name = mkOption { │
│ @@ -37,36 +61,22 @@ in { │
│ default = false; │
│ }; │
│ │
│ - admin = { │
│ - name = mkOption { │
│ - type = str; │
│ - default = "ooks"; │
│ - }; │
│ - shell = mkOption { │
│ - type = enum ["bash" "zsh" "fish"]; │
│ - default = "fish"; │
│ + admin = │
│ + userOptions │
│ + // { │
│ + gitName = mkOption { │
│ + type = str; │
│ + default = "ooks-io"; │
│ + }; │
│ + gitEmail = mkOption { │
│ + type = str; │
│ + default = "[email protected]"; │
│ + }; │
│ }; │
│ - gitName = mkOption { │
│ - type = str; │
│ - default = "ooks-io"; │
│ + guest = │
│ + userOptions │
│ + // { │
│ + enable = mkEnableOption "Enable guest user"; │
│ }; │
│ - gitEmail = mkOption { │
│ - type = str; │
│ - default = "[email protected]"; │
│ - }; │
│ - email = mkOption { │
│ - type = str; │
│ - default = "[email protected]"; │
│ - }; │
│ - homeManager = mkOption { │
│ - type = bool; │
│ - default = false; │
│ - description = '' │
│ - Home-manager is enabled if ooknet.host.role == "workstation". │
│ - If host is not a workstation and you would like to enable home-manager │
│ - enable this option. │
│ - ''; │
│ - }; │
│ - }; │
│ }; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ modules/nixos/base/options.nix ─────┐
│ diff --git a/modules/nixos/base/options.nix │
│ b/modules/nixos/base/options.nix │
│ index ff3fcc6..59d430d 100644 │
│ --- a/modules/nixos/base/options.nix │
│ +++ b/modules/nixos/base/options.nix │
│ @@ -5,6 +5,30 @@ │
│ }: let │
│ inherit (lib) mkEnableOption mkOption; │
│ inherit (lib.types) str enum bool package │
│ ; │
│ + │
│ + userOptions = { │
│ + name = mkOption { │
│ + type = str; │
│ + default = "ooks"; │
│ + }; │
│ + shell = mkOption { │
│ + type = enum ["bash" "zsh" "fish"]; │
│ + default = "fish"; │
│ + }; │
│ + email = mkOption { │
│ + type = str; │
│ + default = "[email protected]"; │
│ + }; │
│ + homeManager = mkOption { │
│ + type = bool; │
│ + default = false; │
│ + description = '' │
│ + Home-manager is enabled if ooknet.h │
│ ost.role == "workstation". │
│ + If host is not a workstation and yo │
│ u would like to enable home-manager │
│ + enable this option. │
│ + ''; │
│ + }; │
│ + }; │
│ in { │
│ options.ooknet.host = { │
│ name = mkOption { │
│ @@ -37,36 +61,22 @@ in { │
│ default = false; │
│ }; │
│ │
│ - admin = { │
│ - name = mkOption { │
│ - type = str; │
│ - default = "ooks"; │
│ - }; │
│ - shell = mkOption { │
│ - type = enum ["bash" "zsh" "fish"]; │
│ - default = "fish"; │
│ + admin = │
│ + userOptions │
│ + // { │
│ + gitName = mkOption { │
│ + type = str; │
│ + default = "ooks-io"; │
│ + }; │
│ + gitEmail = mkOption { │
│ + type = str; │
│ + default = "[email protected]"; │
│ + }; │
│ }; │
│ - gitName = mkOption { │
│ - type = str; │
│ - default = "ooks-io"; │
│ + guest = │
│ + userOptions │
│ + // { │
│ + enable = mkEnableOption "Enable gue │
│ st user"; │
│ }; │
│ - gitEmail = mkOption { │
│ - type = str; │
│ - default = "[email protected]"; │
│ - }; │
│ - email = mkOption { │
│ - type = str; │
│ - default = "[email protected]"; │
│ - }; │
│ - homeManager = mkOption { │
│ - type = bool; │
│ - default = false; │
│ - description = '' │
│ - Home-manager is enabled if ooknet │
│ .host.role == "workstation". │
│ - If host is not a workstation and │
│ you would like to enable home-manager │
│ - enable this option. │
│ - ''; │
│ - }; │
│ - }; │
│ }; │
│ } │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET