From 39cdee742d0ce74ecff1385453c376b908d59510 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 16 Jan 2025 17:12:11 -0600 Subject: [PATCH] fix iso --- lib/generators.nix | 7 +--- modules/essentials.nix | 44 ++++++++++++++++++++ modules/nix-improved.nix | 47 +++++++++++++++++++++ modules/nix.nix | 89 ---------------------------------------- modules/oizys.nix | 4 +- 5 files changed, 95 insertions(+), 96 deletions(-) create mode 100644 modules/nix-improved.nix delete mode 100644 modules/nix.nix diff --git a/lib/generators.nix b/lib/generators.nix index 9a44d9a..af5ff1a 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -5,7 +5,6 @@ ... }: let - inherit (builtins) filter; inherit (lib) nixosSystem mkDefaultOizysModule @@ -21,13 +20,12 @@ let nixosModules = names: names |> listify |> map (n: inputs.${n}.nixosModules.default); selfModules = names: names |> listify |> map (n: self.nixosModules.${n}); - # generate anonymous module to set oizys settings from existing plaintext files - commonSpecialArgs = { inherit self inputs lib + flake enabled ; }; @@ -38,7 +36,7 @@ let { nixpkgs.hostPlatform = "x86_64-linux"; } ] ++ (nixosModules "lix-module") - ++ (selfModules "nix|essentials|iso"); + ++ (selfModules "essentials|iso"); specialArgs = commonSpecialArgs; }; @@ -55,7 +53,6 @@ let specialArgs = commonSpecialArgs // { inherit - flake mkDefaultOizysModule mkOizysModule listify diff --git a/modules/essentials.nix b/modules/essentials.nix index 43dfe5b..11b6df5 100644 --- a/modules/essentials.nix +++ b/modules/essentials.nix @@ -1,6 +1,8 @@ { + inputs, pkgs, self, + flake, enabled, ... }: @@ -19,5 +21,47 @@ wget curl htop + + (flake.pkg "self") + + pkgs.nix-output-monitor ]; + + nixpkgs.config.allowUnfree = true; + nix = { + optimise.automatic = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + + # use the same nixpkgs for nix run "nixpkgs#hello" style commands + registry.nixpkgs.flake = inputs.nixpkgs; + }; + + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + "pipe-operator" + ]; + use-xdg-base-directories = true; + trusted-users = [ "@wheel" ]; + accept-flake-config = true; + extra-substituters = [ + "https://attic.dayl.in/oizys" + "https://nixpkgs-wayland.cachix.org" + # "https://hyprland.cachix.org" + # "https://daylin.cachix.org" + ]; + extra-trusted-public-keys = [ + "oizys:DSw3mwVMM/Y+PXSVpkDlU5dLwlORuiJRGPkwr5INSMc=" + "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" + # "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + # "daylin.cachix.org-1:fLdSnbhKjtOVea6H9KqXeir+PyhO+sDSPhEW66ClE/k=" + ]; + }; + }; } diff --git a/modules/nix-improved.nix b/modules/nix-improved.nix new file mode 100644 index 0000000..adaa3ff --- /dev/null +++ b/modules/nix-improved.nix @@ -0,0 +1,47 @@ +{ + inputs, + pkgs, + lib, + enabled, + ... +}: +let + inherit (lib) makeBinPath; +in +{ + imports = [ inputs.nix-index-database.nixosModules.nix-index ]; + + # https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html#_nix-shell_vs_nix_shell + # use the same nixpkgs for nix-shell -p hello style commands + # I don't know that this is necesary... + # nix.nixPath = [ "nixpkgs=/etc/channels/nixpkgs" ]; + # environment.etc."channels/nixpkgs".source = inputs.nixpkgs.outPath; + + environment.systemPackages = [ + pkgs.nixd + pkgs.nixfmt-rfc-style + ]; + + programs.nix-index-database.comma = enabled; + + # nix-index didn't like this being enabled? + programs.command-not-found.enable = false; + + # I'm getting errors related to a non-existent nix-index? + programs.nix-index.enableZshIntegration = false; + programs.nix-index.enableBashIntegration = false; + programs.nix-index.enableFishIntegration = false; + + system.activationScripts.diff = '' + if [[ -e /run/current-system ]]; then + PATH=$PATH:${ + makeBinPath [ + pkgs.nvd + pkgs.nix + ] + } + nvd diff /run/current-system "$systemConfig" + fi + ''; + +} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index e85d3a2..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ - inputs, - pkgs, - lib, - enabled, - flake, - ... -}: -let - inherit (lib) makeBinPath; -in -{ - imports = [ inputs.nix-index-database.nixosModules.nix-index ]; - - nixpkgs.config.allowUnfree = true; - # nix.package = pkgs.nixVersions.latest; - nix = { - settings = { - experimental-features = [ - "nix-command" - "flakes" - "pipe-operator" - ]; - use-xdg-base-directories = true; - }; - - optimise.automatic = true; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - - # use the same nixpkgs for nix run "nixpkgs#hello" style commands - registry.nixpkgs.flake = inputs.nixpkgs; - }; - - # https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html#_nix-shell_vs_nix_shell - # use the same nixpkgs for nix-shell -p hello style commands - # I don't know that this is necesary... - # nix.nixPath = [ "nixpkgs=/etc/channels/nixpkgs" ]; - # environment.etc."channels/nixpkgs".source = inputs.nixpkgs.outPath; - - environment.systemPackages = [ - pkgs.nixd - pkgs.nixfmt-rfc-style - pkgs.nix-output-monitor - (flake.pkg "self") - ]; - - programs.nix-index-database.comma = enabled; - - # nix-index didn't like this being enabled? - programs.command-not-found.enable = false; - - # I'm getting errors related to a non-existent nix-index? - programs.nix-index.enableZshIntegration = false; - programs.nix-index.enableBashIntegration = false; - programs.nix-index.enableFishIntegration = false; - - system.activationScripts.diff = '' - if [[ -e /run/current-system ]]; then - PATH=$PATH:${ - makeBinPath [ - pkgs.nvd - pkgs.nix - ] - } - nvd diff /run/current-system "$systemConfig" - fi - ''; - - nix.settings = { - trusted-users = [ "@wheel" ]; - accept-flake-config = true; - extra-substituters = [ - "https://attic.dayl.in/oizys" - "https://nixpkgs-wayland.cachix.org" - # "https://hyprland.cachix.org" - # "https://daylin.cachix.org" - ]; - extra-trusted-public-keys = [ - "oizys:DSw3mwVMM/Y+PXSVpkDlU5dLwlORuiJRGPkwr5INSMc=" - "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" - # "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - # "daylin.cachix.org-1:fLdSnbhKjtOVea6H9KqXeir+PyhO+sDSPhEW66ClE/k=" - ]; - }; -} diff --git a/modules/oizys.nix b/modules/oizys.nix index b593a2f..1bfd59c 100644 --- a/modules/oizys.nix +++ b/modules/oizys.nix @@ -19,9 +19,9 @@ in imports = with self.nixosModules; [ users runes - nix - essentials + + nix-improved cli nvim vpn