diff --git a/common/boot/default.nix b/common/boot/default.nix new file mode 100644 index 0000000..9561386 --- /dev/null +++ b/common/boot/default.nix @@ -0,0 +1,35 @@ +{ config, lib, ... }: +let + ccfg = import ../config.nix; + cfg = config.${ccfg.custom_config_key}.boot; +in +{ + imports = [ + ./grub.nix + ./systemd.nix + ]; + config = { + assertions = [ + ( + let + enabledBootloaders = lib.filter (x: x.enabled) [ + { + name = "systemd"; + enabled = cfg.systemd.enable; + } + { + name = "grub"; + enabled = cfg.grub.enable; + } + ]; + in + { + assertion = lib.length enabledBootloaders <= 1; + message = + "Only one bootloader can be enabled at a time. Enabled: " + + lib.concatStringsSep ", " (map (x: x.name) enabledBootloaders); + } + ) + ]; + }; +} diff --git a/common/boot/grub.nix b/common/boot/grub.nix index c174350..c922d57 100644 --- a/common/boot/grub.nix +++ b/common/boot/grub.nix @@ -5,20 +5,27 @@ }: let ccfg = import ../config.nix; - cfg_path = "${ccfg.custom_config_key}".boot.grub; - cfg = config.${cfg_path}; + cfg_path = [ + ccfg.custom_config_key + "boot" + "grub" + ]; + cfg = lib.attrsets.getAttrFromPath cfg_path config; in { - options.${ccfg.custom_config_key}.boot.grub = { - enable = lib.mkEnableOption "Grub bootloader"; - device = lib.mkOption { - type = lib.types.str; - default = "/dev/sda"; - description = '' - The device to install GRUB on. - ''; + options = + { } + // lib.attrsets.setAttrByPath cfg_path { + enable = lib.mkEnableOption "Grub bootloader"; + device = lib.mkOption { + type = lib.types.str; + default = "/dev/sda"; + description = '' + The device to install GRUB on. + ''; + }; }; - }; + config = lib.mkIf cfg.enable { boot.loader.grub = { enable = true; diff --git a/common/boot/systemd.nix b/common/boot/systemd.nix index de3ca50..7021795 100644 --- a/common/boot/systemd.nix +++ b/common/boot/systemd.nix @@ -5,13 +5,19 @@ }: let ccfg = import ../config.nix; - cfg_path = "${ccfg.custom_config_key}".boot.systemd; - cfg = config.${cfg_path}; + cfg_path = [ + ccfg.custom_config_key + "boot" + "systemd" + ]; + cfg = lib.attrsets.getAttrFromPath cfg_path config; in { - options.${cfg_path} = { - enable = lib.mkEnableOption "Systemd bootloader"; - }; + options = + { } + // lib.attrsets.setAttrByPath cfg_path { + enable = lib.mkEnableOption "Systemd bootloader"; + }; config = lib.mkIf cfg.enable { boot.loader = { systemd-boot = { diff --git a/common/config.nix b/common/config.nix index 1101fb1..3292380 100644 --- a/common/config.nix +++ b/common/config.nix @@ -1,3 +1,3 @@ { - config_prefix = "ringofstorms_common"; + custom_config_key = "ringofstorms_common"; } diff --git a/common/flake.nix b/common/flake.nix index 87526d1..3f0faee 100644 --- a/common/flake.nix +++ b/common/flake.nix @@ -3,17 +3,12 @@ home-manager.url = "github:rycee/home-manager/release-24.11"; ragenix.url = "github:yaxitech/ragenix"; - ros_neovim.url = "git+https://git.joshuabell.xyz/nvim"; - ringofstorms-stormd.url = "git+ssh://git.joshuabell.xyz:3032/stormd"; - # ros_neovim.url = "path:/home/josh/projects/stormd"; - hyprland.url = "github:hyprwm/Hyprland"; cosmic.url = "github:lilyinstarlight/nixos-cosmic"; }; outputs = { - ros_neovim, ... }: { @@ -31,9 +26,9 @@ in { imports = [ - ./boot/grub.nix - ./boot/systemd.nix - ./users/users.nix + ./boot + ./users + ./general ]; options.${cfg_path} = { systemName = lib.mkOption { diff --git a/common/general/default.nix b/common/general/default.nix new file mode 100644 index 0000000..f0d5397 --- /dev/null +++ b/common/general/default.nix @@ -0,0 +1,182 @@ +{ + config, + lib, + ... +}: +let + ccfg = import ../config.nix; + cfg_path = [ + ccfg.custom_config_key + "general" + ]; + cfg = lib.attrsets.getAttrFromPath cfg_path config; + top_cfg = config.${ccfg.custom_config_key}; +in +{ + options = + { } + // lib.attrsets.setAttrByPath cfg_path { + flakeOptions = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Enable nix flake options"; + }; + unfree = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Enable unfree packages"; + }; + readWindowsDrives = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Read windows drives"; + }; + disableRemoteBuildsOnLio = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Disable remote builds on lio"; + }; + timezone = lib.mkOption { + type = lib.types.str; + default = "America/Chicago"; + description = "Timezone"; + }; + defaultLocal = lib.mkOption { + type = lib.types.str; + default = "en_US.UTF-8"; + description = "Default locale"; + }; + fastShutdown = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Fast shutdown"; + }; + enableSleep = lib.mkEnableOption (lib.mdDoc "Enable auto sleeping"); + }; + config = { + # name this computer + networking = { + hostName = top_cfg.systemName; + }; + + # Enable flakes + nix.settings.experimental-features = lib.mkIf cfg.flakeOptions [ + "nix-command" + "flakes" + ]; + + # Allow unfree + nixpkgs.config.allowUnfree = cfg.unfree; + nixpkgs.config.allowUnfreePredicate = (pkg: cfg.unfree); + environment.variables = lib.mkIf cfg.unfree { + NIXPKGS_ALLOW_UNFREE = "1"; + }; + + # allow mounting ntfs filesystems + boot.supportedFilesystems = lib.mkIf cfg.readWindowsDrives [ "ntfs" ]; + + # make shutdown faster for waiting + systemd.extraConfig = lib.mkIf cfg.fastShutdown '' + DefaultTimeoutStopSec=8s + ''; + + nix.settings = { + max-jobs = "auto"; + # Fallback quickly if substituters are not available. + connect-timeout = 5; + download-attempts = 3; + # The default at 10 is rarely enough. + log-lines = 50; + # Avoid disk full issues + max-free = (3000 * 1024 * 1024); + min-free = (1000 * 1024 * 1024); + # Avoid copying unnecessary stuff over SSH + builders-use-substitutes = true; + auto-optimise-store = true; + trusted-users = [ + "root" + "@wheel" + ]; + substituters = [ + "https://hyprland.cachix.org" + "https://cosmic.cachix.org/" + ]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" + ]; + }; + nix.extraOptions = '' + keep-outputs = true + keep-derivations = true + ${lib.optionalString ( + # TODO revisit this should it move? + config ? age && config.age ? secrets && config.age.secrets ? github_read_token + ) "!include ${config.age.secrets.github_read_token.path}"} + ''; + + # nix helper + programs.nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep 10"; + # `flake` path is set in users/default.nix for the primary user if set + }; + + # Remote build off home lio computer + programs.ssh.extraConfig = lib.mkIf (!cfg.disableRemoteBuildsOnLio) '' + Host lio_ + PubkeyAcceptedKeyTypes ssh-ed25519 + ServerAliveInterval 60 + IPQoS throughput + ${lib.optionalString ( + config ? age && config.age ? secrets && config.age.secrets ? nix2lio + ) "IdentityFile ${config.age.secrets.nix2lio.path}"} + ''; + nix = { + distributedBuilds = lib.mkIf (!cfg.disableRemoteBuildsOnLio) true; + buildMachines = lib.mkIf (!cfg.disableRemoteBuildsOnLio) [ + { + hostName = "lio"; + system = "x86_64-linux"; + protocol = "ssh-ng"; + maxJobs = 32; + speedFactor = 2; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + "uid-range" # Often helpful + ]; + mandatoryFeatures = [ ]; + } + ]; + }; + + # TODO can I make this Roaming automatically somehow? + time.timeZone = cfg.timezone; + # Select internationalization properties. + i18n.defaultLocale = cfg.defaultLocal; + i18n.extraLocaleSettings = { + LC_ADDRESS = cfg.defaultLocal; + LC_IDENTIFICATION = cfg.defaultLocal; + LC_MEASUREMENT = cfg.defaultLocal; + LC_MONETARY = cfg.defaultLocal; + LC_NAME = cfg.defaultLocal; + LC_NUMERIC = cfg.defaultLocal; + LC_PAPER = cfg.defaultLocal; + LC_TELEPHONE = cfg.defaultLocal; + LC_TIME = cfg.defaultLocal; + }; + + # Turn off sleep + systemd.sleep.extraConfig = lib.mkIf (!cfg.enableSleep) '' + [Sleep] + AllowSuspend=no + AllowHibernation=no + AllowSuspendThenHibernate=no + AllowHybridSleep=no + ''; + }; +} diff --git a/common/users/default.nix b/common/users/default.nix new file mode 100644 index 0000000..11b1cd6 --- /dev/null +++ b/common/users/default.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + ... +}: +let + ccfg = import ../config.nix; + cfg_path = [ + ccfg.custom_config_key + "users" + ]; + cfg = lib.attrsets.getAttrFromPath cfg_path config; + top_cfg = config.${ccfg.custom_config_key}; +in +{ + options = + { } + // lib.attrsets.setAttrByPath cfg_path { + admins = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ "josh" ]; + description = '' + List of users to be added to the system. + ''; + }; + primary = lib.mkOption { + type = lib.types.str; + default = lib.optionalString (cfg.admins != [ ] && cfg.admins != null) ( + builtins.elemAt cfg.admins 0 + ); + description = "The primary user of the system."; + }; + users = lib.mkOption { + type = lib.types.attrsOf lib.types.attrs; + default = { }; + description = "Normal users to configure (not for system users). Should match nix options of users.userser..*"; + }; + }; + config = { + users.users = lib.mapAttrs ( + name: userConfig: + userConfig + // { + inherit name; + isNormalUser = true; +# TODO + # initialPassword = lib.mkIf ( + # userConfig.initialPassword != null + # ) userConfig.initialPassword "password1"; + extraGroups = + lib.optionals (builtins.elem name cfg.admins) [ "wheel" ] ++ (userConfig.extraGroups or [ ]); + } + ) cfg.users; + + programs.nh.flake = lib.mkIf (lib.hasAttr "primary" cfg) "/home/${cfg.primary}/.config/nixos-config/hosts/${top_cfg.systemName}"; + }; +} diff --git a/common/users/user.nix b/common/users/user.nix deleted file mode 100644 index 81079bb..0000000 --- a/common/users/user.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - username, -}: -{ config, ... }: -{ - users.user.${username} = { - - }; -} diff --git a/common/users/users.nix b/common/users/users.nix deleted file mode 100644 index 5f3c1e9..0000000 --- a/common/users/users.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - config, - lib, - ... -}: -let - ccfg = import ../config.nix; - cfg_path = "${ccfg.custom_config_key}".users; - cfg = config.${cfg_path}; - top_cfg = config."${ccfg.custom_config_key}"; -in -{ - option.${cfg_path} = { - adminUsers = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - example = [ "josh" ]; - description = '' - List of users to be added to the system. - ''; - }; - primaryUser = lib.mkOption { - type = lib.types.str; - default = lib.optionalString (cfg.adminUsers != [ ] && cfg.adminUsers != null) ( - builtins.elemAt cfg.adminUsers 0 - ); - description = "The primary user of the system."; - }; - users = lib.mkOption { - type = lib.types.attrsOf lib.types.attrs; - default = { }; - description = "Normal* users to configure (not for system users). Should match nix options of users.userser..*"; - }; - }; - config = - { - users.users = lib.mapAttrs ( - name: config: - { - inherit name; - isNormalUser = true; - } - // config - ) cfg.users; - - programs.nh.flake = "/home/${cfg.primaryUser}/.config/nixos-config/hosts/${top_cfg.systemName}"; - } - // lib.map (name: { - users.users.${name} = { - extraGroups = [ "wheel" ]; - }; - }) cfg.adminUsers; -} diff --git a/components/nix/lua.nix b/components/nix/lua.nix deleted file mode 100644 index 6809860..0000000 --- a/components/nix/lua.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ lua ]; -} - diff --git a/components/nix/qdirstat.nix b/components/nix/qdirstat.nix deleted file mode 100644 index e647d90..0000000 --- a/components/nix/qdirstat.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: -{ - environment.systemPackages = [ pkgs.qdirstat ]; -} diff --git a/hosts/lio/flake.lock b/hosts/lio/flake.lock index 002c253..4f8ae1a 100644 --- a/hosts/lio/flake.lock +++ b/hosts/lio/flake.lock @@ -4,12 +4,37 @@ "inputs": { "darwin": "darwin", "home-manager": "home-manager_2", + "nixpkgs": [ + "common", + "ragenix", + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1736955230, + "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", + "owner": "ryantm", + "repo": "agenix", + "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "agenix_2": { + "inputs": { + "darwin": "darwin_2", + "home-manager": "home-manager_4", "nixpkgs": [ "mod_secrets", "ragenix", "nixpkgs" ], - "systems": "systems" + "systems": "systems_4" }, "locked": { "lastModified": 1723293904, @@ -25,7 +50,97 @@ "type": "github" } }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "common", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1741934125, + "narHash": "sha256-qwI47l3aKXRpDvmCKDbLV70iVfAqhpuKqT7qYHA4KJk=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "bea48d0bbe15fb3d758a8b6be865836c97056575", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "common": { + "inputs": { + "cosmic": "cosmic", + "home-manager": "home-manager", + "hyprland": "hyprland", + "ragenix": "ragenix" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-OJ2YO3MrbG9H3+wDhHP7K0vlZyWW2ywyBuc9bQSFa4c=", + "path": "../../common", + "type": "path" + }, + "original": { + "path": "../../common", + "type": "path" + } + }, + "cosmic": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1742166771, + "narHash": "sha256-8IuaS/sjMUEqn6wDfidZRKgCfTXBIsfK+Fxfam0EvKM=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "fcee247f21d21acb738ac208d6ed86e65c2e7240", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "crane": { + "locked": { + "lastModified": 1741481578, + "narHash": "sha256-JBTSyJFQdO3V8cgcL08VaBUByEU6P5kXbTJN6R0PFQo=", + "owner": "ipetkov", + "repo": "crane", + "rev": "bb1c9567c43e4434f54e9481eb4b8e8e0d50f0b5", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "crane_2": { "locked": { "lastModified": 1725409566, "narHash": "sha256-PrtLmqhM6UtJP7v7IGyzjBFhbG4eOAHT6LPYOFmYfbk=", @@ -41,6 +156,30 @@ } }, "darwin": { + "inputs": { + "nixpkgs": [ + "common", + "ragenix", + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "darwin_2": { "inputs": { "nixpkgs": [ "mod_secrets", @@ -64,9 +203,59 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_5" }, "locked": { "lastModified": 1710146030, @@ -82,7 +271,72 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1739757849, + "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=", + "owner": "rycee", + "repo": "home-manager", + "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe", + "type": "github" + }, + "original": { + "owner": "rycee", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "common", + "ragenix", + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { "inputs": { "nixpkgs": [ "mod_home-manager", @@ -104,7 +358,7 @@ "type": "github" } }, - "home-manager_2": { + "home-manager_4": { "inputs": { "nixpkgs": [ "mod_secrets", @@ -127,20 +381,285 @@ "type": "github" } }, - "mod_boot_systemd": { + "hyprcursor": { + "inputs": { + "hyprlang": [ + "common", + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, "locked": { - "lastModified": 1735793935, - "narHash": "sha256-ZmdChqcyS/6cal5pKKmzqfVkg9TbYM9jRa5LhziceiI=", - "ref": "mod_boot_systemd", - "rev": "3155d8a57286aefb835476617ba6d4df92b83013", - "revCount": 1, - "type": "git", - "url": "https://git.joshuabell.xyz/dotfiles" + "lastModified": 1738664950, + "narHash": "sha256-xIeGNM+iivwVHkv9tHwOqoUP5dDrtees34bbFKKMZYs=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "7c6d165e1eb9045a996551eb9f121b6d1b30adc3", + "type": "github" }, "original": { - "ref": "mod_boot_systemd", - "type": "git", - "url": "https://git.joshuabell.xyz/dotfiles" + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739049071, + "narHash": "sha256-3+7TpXMrbsUXSwgr5VAKAnmkzMb6JO+Rvc9XRb5NMg4=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "175c6b29b6ff82100539e7c4363a35a02c74dd73", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1742161820, + "narHash": "sha256-MURJd3lgE1EGwBmJRAzk+AIzv84HUt1xla9XSy1BZMs=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "22154fa272201950a3d37e2a40d9dc3a9cc92329", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1738422629, + "narHash": "sha256-5v+bv75wJWvahyM2xcMTSNNxmV8a7hb01Eey5zYnBJw=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "755aef8dab49d0fc4663c715fa4ad221b2aedaed", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "common", + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "common", + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1737634706, + "narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "8810df502cdee755993cb803eba7b23f189db795", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "common", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "common", + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739048983, + "narHash": "sha256-REhTcXq4qs3B3cCDtLlYDz0GZvmsBSh947Ub6pQWGTQ=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "3504a293c8f8db4127cb0f7cfc1a318ffb4316f8", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1741191527, + "narHash": "sha256-kM+11Nch47Xwfgtw2EpRitJuORy4miwoMuRi5tyMBDY=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "72df3861f1197e41b078faa3e38eedd60e00018d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1741534688, + "narHash": "sha256-EV3945SnjOCuRVbGRghsWx/9D89FyshnSO1Q6/TuQ14=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "dd1f720cbc2dbb3c71167c9598045dd3261d27b3", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739870480, + "narHash": "sha256-SiDN5BGxa/1hAsqhgJsS03C3t2QrLgBT8u+ENJ0Qzwc=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "206367a08dc5ac4ba7ad31bdca391d098082e64b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" } }, "mod_common": { @@ -177,8 +696,8 @@ }, "mod_home-manager": { "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "home-manager": "home-manager_3", + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1736544172, @@ -232,7 +751,7 @@ }, "mod_secrets": { "inputs": { - "ragenix": "ragenix" + "ragenix": "ragenix_2" }, "locked": { "lastModified": 1739431881, @@ -265,6 +784,86 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1742069588, + "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1741862977, + "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1741851582, + "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1741379970, + "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1736344531, "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", @@ -280,7 +879,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_6": { "locked": { "lastModified": 1728888510, "narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", @@ -296,7 +895,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_7": { "locked": { "lastModified": 1725634671, "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", @@ -312,7 +911,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_8": { "locked": { "lastModified": 1740463929, "narHash": "sha256-4Xhu/3aUdCKeLfdteEHMegx5ooKQvwPHNkOgNCXQrvc=", @@ -328,7 +927,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_9": { "locked": { "lastModified": 1741704334, "narHash": "sha256-QqX3y+biQ7Q334y3FxYRGUtHl213D03z8EXQj6I8GWI=", @@ -1255,13 +1854,59 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741379162, + "narHash": "sha256-srpAbmJapkaqGRE3ytf3bj4XshspVR5964OX5LfjDWc=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "ragenix": { "inputs": { "agenix": "agenix", "crane": "crane", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_3", - "rust-overlay": "rust-overlay_2" + "nixpkgs": "nixpkgs_4", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1741508717, + "narHash": "sha256-iQf1WdNxaApOFHIx4RLMRZ4f8g+8Xp0Z1/E/Mz2rLxY=", + "owner": "yaxitech", + "repo": "ragenix", + "rev": "2a2bea99d74927e54adf53cbf113219def67d5c9", + "type": "github" + }, + "original": { + "owner": "yaxitech", + "repo": "ragenix", + "type": "github" + } + }, + "ragenix_2": { + "inputs": { + "agenix": "agenix_2", + "crane": "crane_2", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_7", + "rust-overlay": "rust-overlay_3" }, "locked": { "lastModified": 1726755133, @@ -1280,8 +1925,8 @@ "ringofstorms-stormd": { "inputs": { "nix-filter": "nix-filter", - "nixpkgs": "nixpkgs_2", - "rust-overlay": "rust-overlay" + "nixpkgs": "nixpkgs_6", + "rust-overlay": "rust-overlay_2" }, "locked": { "lastModified": 1735420577, @@ -1299,20 +1944,20 @@ }, "root": { "inputs": { - "mod_boot_systemd": "mod_boot_systemd", + "common": "common", "mod_common": "mod_common", "mod_de_gnome": "mod_de_gnome", "mod_home-manager": "mod_home-manager", "mod_nebula": "mod_nebula", "mod_ros_stormd": "mod_ros_stormd", "mod_secrets": "mod_secrets", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_8", "ros_neovim": "ros_neovim" } }, "ros_neovim": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_9", "nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim", "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim", "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring", @@ -1370,14 +2015,14 @@ "nvim_plugin-yetone/avante.nvim": "nvim_plugin-yetone/avante.nvim", "nvim_plugin-zbirenbaum/copilot-cmp": "nvim_plugin-zbirenbaum/copilot-cmp", "nvim_plugin-zbirenbaum/copilot.lua": "nvim_plugin-zbirenbaum/copilot.lua", - "rust-overlay": "rust-overlay_3" + "rust-overlay": "rust-overlay_4" }, "locked": { - "lastModified": 1741704522, - "narHash": "sha256-TtJhL9x9TatdU1mi4HQog4JULCfT2ABvQB+mlq75atA=", + "lastModified": 1742183843, + "narHash": "sha256-rnIuWHui65AOuTYqZqpBbauI70iU08orr2/lPqYK3iQ=", "ref": "refs/heads/master", - "rev": "b5efa3362ae29236e006879d35d184d900acc984", - "revCount": 264, + "rev": "d8295af1e90b89f9b2c38058fdb392395b36cf84", + "revCount": 267, "type": "git", "url": "https://git.joshuabell.xyz/nvim" }, @@ -1387,6 +2032,28 @@ } }, "rust-overlay": { + "inputs": { + "nixpkgs": [ + "common", + "ragenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741400194, + "narHash": "sha256-tEpgT+q5KlGjHSm8MnINgTPErEl8YDzX3Eps8PVc09g=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "16b6045a232fea0e9e4c69e55a6e269607dd8e3f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { "inputs": { "nixpkgs": [ "mod_ros_stormd", @@ -1408,7 +2075,7 @@ "type": "github" } }, - "rust-overlay_2": { + "rust-overlay_3": { "inputs": { "nixpkgs": [ "mod_secrets", @@ -1430,7 +2097,7 @@ "type": "github" } }, - "rust-overlay_3": { + "rust-overlay_4": { "inputs": { "nixpkgs": [ "ros_neovim", @@ -1453,16 +2120,16 @@ }, "systems": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -1480,6 +2147,98 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "common", + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "common", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "common", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "common", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "common", + "hyprland", + "nixpkgs" + ], + "systems": [ + "common", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1741934139, + "narHash": "sha256-ZhTcTH9FoeAtbPfWGrhkH7RjLJZ7GeF18nygLAMR+WE=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "150b0b6f52bb422a1b232a53698606fe0320dde0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/hosts/lio/flake.nix b/hosts/lio/flake.nix index 412fc80..2229985 100644 --- a/hosts/lio/flake.nix +++ b/hosts/lio/flake.nix @@ -3,11 +3,15 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; # nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # Use relative to get current version for testing + common.url = "path:../../common"; + # Pin to specific version + # common.url = "git+https://git.joshuabell.xyz/dotfiles?rev=88f2d95e6a871f084dccfc4f45ad9d2b31720998"; + ros_neovim.url = "git+https://git.joshuabell.xyz/nvim"; mod_common.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_common"; mod_home-manager.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_home_manager"; mod_secrets.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_secrets"; - mod_boot_systemd.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_boot_systemd"; mod_de_gnome.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_de_gnome"; mod_ros_stormd.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_stormd"; mod_nebula.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_nebula"; @@ -44,14 +48,50 @@ { config, pkgs, ... }: { imports = [ - ../../components/nix/lua.nix ../../components/nix/rust-dev.nix ../../components/nix/qflipper.nix - ../../components/nix/qdirstat.nix ../../components/nix/steam.nix ../../components/nix/tailscale.nix ]; + ringofstorms_common = { + systemName = configuration_name; + boot.systemd.enable = true; + general = { + # NOTE bunch of defaults in here I dont need to change + }; + users = { + # Users are all normal users and default password is password1 + admins = [ "josh" ]; # First admin is also the primary user owning nix config + users = { + josh = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJN2nsLmAlF6zj5dEBkNSJaqcCya+aB6I0imY8Q5Ew0S nix2lio" + ]; + extraGroups = [ + "networkmanager" + "video" + "input" + ]; + shell = pkgs.zsh; + packages = with pkgs; [ + signal-desktop + spotify + blender + google-chrome + discordo + discord + firefox-esr + openscad + vlc + bitwarden + vaultwarden + ]; + }; + }; + }; + }; + environment.systemPackages = with pkgs; [ lua qdirstat @@ -75,33 +115,6 @@ docker = true; zsh = true; users = { - josh = { - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJN2nsLmAlF6zj5dEBkNSJaqcCya+aB6I0imY8Q5Ew0S nix2lio" - ]; - initialPassword = "password1"; - isNormalUser = true; - extraGroups = [ - "wheel" - "networkmanager" - "video" - "input" - ]; - shell = pkgs.zsh; - packages = with pkgs; [ - signal-desktop - spotify - blender - google-chrome - discordo - discord - firefox-esr - openscad - vlc - bitwarden - vaultwarden - ]; - }; }; }; home_manager = {