feat(*): new machine 'gomphrena'
11 files changed, -18/+149
flake.lock
@@ -42,6 +42,22 @@ "type": "github" } },+ "flake-compat": {+ "flake": false,+ "locked": {+ "lastModified": 1767039857,+ "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",+ "owner": "edolstra",+ "repo": "flake-compat",+ "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",+ "type": "github"+ },+ "original": {+ "owner": "edolstra",+ "repo": "flake-compat",+ "type": "github"+ }+ }, "home-manager": { "inputs": { "nixpkgs": [@@ -124,6 +140,27 @@ "type": "github" } },+ "nixos-wsl": {+ "inputs": {+ "flake-compat": "flake-compat",+ "nixpkgs": [+ "nixpkgs"+ ]+ },+ "locked": {+ "lastModified": 1773882647,+ "narHash": "sha256-VzcOcE0LLpEnyoxLuMuptZ9ZWCkSBn99bTgEQoz5Viw=",+ "owner": "nix-community",+ "repo": "NixOS-WSL",+ "rev": "fd0eae98d1ecee31024271f8d64676250a386ee7",+ "type": "github"+ },+ "original": {+ "owner": "nix-community",+ "repo": "NixOS-WSL",+ "type": "github"+ }+ }, "nixpkgs": { "locked": { "lastModified": 1768564909,@@ -162,6 +199,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "llm-agents": "llm-agents",+ "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_2" } },
flake.nix
@@ -4,6 +4,9 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; impermanence.url = "github:nix-community/impermanence"; + nixos-wsl.url = "github:nix-community/NixOS-WSL";+ nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";+ disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs";
home/profiles/default.nix
@@ -8,4 +8,5 @@ let }; in { sunflower = mkProfile "sunflower";+ gomphrena = mkProfile "gomphrena"; }
home/profiles/gomphrena.nix
@@ -0,0 +1,33 @@+{ lib, ... }:++{+ imports = [+ ../features/cli/pi.nix+ ../features/cli/gpg.nix+ ../features/cli/ssh.nix+ ../features/cli/git.nix+ ../features/cli/nvim.nix+ ../features/cli/bash.nix+ ../features/cli/tmux.nix++ ../features/misc/xdg.nix+ ];++ # TMP: neovim suck tbh but it work+ programs.neovim.extraConfig = ''+ let g:clipboard = {+ \ 'name': 'WslClipboard',+ \ 'copy': {+ \ '+': 'clip.exe',+ \ '*': 'clip.exe',+ \ },+ \ 'paste': {+ \ '+': 'powershell.exe -NoLogo -NoProfile -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',+ \ '*': 'powershell.exe -NoLogo -NoProfile -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',+ \ },+ \ 'cache_enabled': 0,+ \ }+ '';++ home.persistence."/persist" = lib.mkForce {};+}
nixos/features/global.nix
@@ -128,7 +128,7 @@ btrfs sub cre "$MNTPOINT/@" ) '';- in {+ in lib.mkIf (config ? "disko" && config.disko.devices.disk ? "main") ({ supportedFilesystems = [ "btrfs" ]; postDeviceCommands = lib.mkIf (!systemdStage1) (lib.mkBefore script); @@ -144,7 +144,7 @@ }; script = script; };- };+ }); fileSystems."/persist".neededForBoot = true; }
nixos/features/kore.nix
@@ -31,7 +31,11 @@ in { hosts = { sunflower = { ipv4 = "0.0.0.0";- roles = [ "workstation" ];+ roles = [ "home" "workstation" ];+ };+ gomphrena = {+ ipv4 = "0.0.0.0";+ roles = [ "home" ]; }; }; currentHost = config.kore.hosts.${config.networking.hostName};
nixos/hosts/default.nix
@@ -18,4 +18,5 @@ let }; in { sunflower = mkSystem "x86_64-linux" "sunflower";+ gomphrena = mkSystem "x86_64-linux" "gomphrena"; }
nixos/hosts/gomphrena.nix
@@ -0,0 +1,41 @@+{ lib, pkgs, inputs, modulesPath, ... }:++{+ imports = [+ inputs.nixos-wsl.nixosModules.default++ ( modulesPath + "/installer/scan/not-detected.nix" )+ ];++ wsl = {+ enable = true;+ defaultUser = "lostduk";+ useWindowsDriver = true;++ usbip = {+ enable = true;+ autoAttach = [ "1-14" ];+ };+ };++ users.users.lostduk = {+ password = "tmp";+ isNormalUser = true;++ extraGroups = [ "wheel" ];+ subUidRanges = [{ startUid = 100000; count = 65536; }];+ subGidRanges = [{ startGid = 100000; count = 65536; }];+ };++ hardware = {+ graphics.enable = true;+ cpu.intel.updateMicrocode = true;+ };++ environment.persistence."/persist" = lib.mkForce {};++ fileSystems."/persist" = {+ enable = lib.mkForce false;+ neededForBoot = lib.mkForce false;+ };+}
nixos/roles/default.nix
@@ -1,5 +1,6 @@ { imports = [- ./workstation.nix+ ./home.nix+ ./desktop.nix ]; }
nixos/roles/workstation.nix → nixos/roles/desktop.nix
@@ -1,22 +1,10 @@-{ inputs, outputs, config, pkgs, lib, ... }:+{ outputs, config, pkgs, lib, ... }: let- roleName = "workstation";+ roleName = "desktop"; roleEnabled = lib.elem roleName config.kore.currentHost.roles; in {- imports = [ inputs.home-manager.nixosModules.home-manager ];- config = lib.mkMerge [{} (lib.mkIf roleEnabled {- home-manager = {- useGlobalPkgs = true;- useUserPackages = true;- extraSpecialArgs = { inherit inputs outputs; };-- users.lostduk = outputs.homeConfigurations.${config.networking.hostName};- };-- programs.fuse.userAllowOther = true;- xdg.portal = { enable = true; extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
nixos/roles/home.nix
@@ -0,0 +1,21 @@+{ inputs, outputs, config, pkgs, lib, ... }:++let+ roleName = "home";+ roleEnabled = lib.elem roleName config.kore.currentHost.roles;+in {+ imports = [ inputs.home-manager.nixosModules.home-manager ];++ config = lib.mkMerge [{} (lib.mkIf roleEnabled {+ home-manager = {+ useGlobalPkgs = true;+ useUserPackages = true;+ extraSpecialArgs = { inherit inputs outputs; };++ users.lostduk = outputs.homeConfigurations.${config.networking.hostName};+ };++ programs.fuse.userAllowOther = true;+ })];+}+