From 0fe2c66bc0657f480cad784df7a7fc5e4913de0e Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 26 Sep 2023 16:53:13 -0400 Subject: [PATCH] flake: refactor references to hlissner/dotfiles --- flake.lock | 198 ++---------------- flake.nix | 3 - lib/default.nix | 2 + lib/options.nix | 18 ++ modules/functionality/ensure.nix | 2 +- modules/functionality/soft-serve.nix | 2 +- modules/global/options.nix | 2 +- modules/modules/boot.nix | 2 +- modules/modules/desktop/gaming.nix | 2 +- modules/modules/desktop/wm.nix | 2 +- modules/modules/hardware/audio.nix | 2 +- modules/modules/hardware/form.nix | 2 +- modules/modules/hardware/gpu.nix | 2 +- .../hardware/peripherals/fprint-sensor.nix | 2 +- .../modules/hardware/peripherals/printing.nix | 2 +- .../modules/hardware/peripherals/razer.nix | 2 +- modules/modules/hardware/wireless.nix | 2 +- modules/modules/locale.nix | 2 +- modules/modules/services/apcupsd.nix | 2 +- modules/modules/services/foldingathome.nix | 2 +- modules/modules/services/proxy.nix | 2 +- modules/modules/software/console.nix | 2 +- modules/modules/software/minipro.nix | 2 +- modules/modules/software/steam.nix | 2 +- modules/modules/virtualization.nix | 2 +- secrets/default.nix | 2 +- 26 files changed, 54 insertions(+), 211 deletions(-) create mode 100644 lib/options.nix diff --git a/flake.lock b/flake.lock index 414acc7..021780d 100644 --- a/flake.lock +++ b/flake.lock @@ -24,31 +24,10 @@ "type": "github" } }, - "agenix_2": { - "inputs": { - "nixpkgs": [ - "hlissner-dotfiles", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1662241716, - "narHash": "sha256-urqPvSvvGUhkwzTDxUI8N1nsdMysbAfjmBNZaTYBZRU=", - "owner": "ryantm", - "repo": "agenix", - "rev": "c96da5835b76d3d8e8d99a0fec6fe32f8539ee2e", - "type": "github" - }, - "original": { - "owner": "ryantm", - "repo": "agenix", - "type": "github" - } - }, "crane": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "nixpkgs": [ "universe-cli", "nixpkgs" @@ -132,25 +111,6 @@ "type": "github" } }, - "emacs-overlay": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1663325995, - "narHash": "sha256-jXn/zFemtAT01xuhmKMhKPDTke7cYHe2IaNmVFQ6/G8=", - "owner": "nix-community", - "repo": "emacs-overlay", - "rev": "b50178f76a7868d0aca28278451141269df137fe", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "emacs-overlay", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -257,21 +217,6 @@ } }, "flake-utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { "inputs": { "systems": "systems_2" }, @@ -289,7 +234,7 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_2": { "inputs": { "systems": "systems_3" }, @@ -307,7 +252,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "inputs": { "systems": "systems_4" }, @@ -325,7 +270,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_4": { "inputs": { "systems": "systems_5" }, @@ -343,7 +288,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_5": { "inputs": { "systems": "systems_7" }, @@ -377,53 +322,7 @@ "type": "github" } }, - "hlissner-dotfiles": { - "inputs": { - "agenix": "agenix_2", - "emacs-overlay": "emacs-overlay", - "home-manager": "home-manager", - "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_3", - "nixpkgs-unstable": "nixpkgs-unstable" - }, - "locked": { - "lastModified": 1663596637, - "narHash": "sha256-uKMuJnCINAJWdEapZeTaenBptJN+rIrh5Ml+9J7Gr+4=", - "owner": "hlissner", - "repo": "dotfiles", - "rev": "089f1a9da9018df9e5fc200c2d7bef70f4546026", - "type": "github" - }, - "original": { - "owner": "hlissner", - "repo": "dotfiles", - "type": "github" - } - }, "home-manager": { - "inputs": { - "nixpkgs": [ - "hlissner-dotfiles", - "nixpkgs" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1663328500, - "narHash": "sha256-7n+J/exp8ky4dmk02y5a9R7CGmJvHpzrHMzfEkMtSWA=", - "owner": "rycee", - "repo": "home-manager", - "rev": "5427f3d1f0ea4357cd4af0bffee7248d640c6ffc", - "type": "github" - }, - "original": { - "owner": "rycee", - "ref": "master", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -476,7 +375,7 @@ "nix-minecraft": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] @@ -497,21 +396,6 @@ } }, "nixos-hardware": { - "locked": { - "lastModified": 1663229557, - "narHash": "sha256-1uU4nsDLXKG0AHc/VCsNBAEPkTA/07juYhcEWRb1O1E=", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "a0df6cd6e199df4a78c833c273781ea92fa62cfb", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixos-hardware", - "type": "github" - } - }, - "nixos-hardware_2": { "locked": { "lastModified": 1695033975, "narHash": "sha256-GIUxbgLBhVyaKRxQw/NWYFLx7/jbKW3+U0HoSsMLPAs=", @@ -529,7 +413,7 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] @@ -564,49 +448,7 @@ "type": "github" } }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1663264531, - "narHash": "sha256-2ncO5chPXlTxaebDlhx7MhL0gOEIWxzSyfsl0r0hxQk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "454887a35de6317a30be284e8adc2d2f6d8a07c4", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixpkgs-unstable", - "type": "indirect" - } - }, "nixpkgs_2": { - "locked": { - "lastModified": 0, - "narHash": "sha256-GGMupfk/lGzPBQ/dRrcQEhiFZ0F5KPg0j5Q4Fb5coxc=", - "path": "/nix/store/r2bbhmlfvfpir9hp8fjs31kj13kwgwyl-source", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1663178737, - "narHash": "sha256-ayOtdyoNx6BqJtTYVzdQCDz/YWb67TY/CMGacFCgNQo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1158501e7c7cba26d922723cf9f70099995eb755", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1694767346, "narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=", @@ -644,14 +486,13 @@ "flake-parts": "flake-parts", "flake-registry": "flake-registry", "fork": "fork", - "hlissner-dotfiles": "hlissner-dotfiles", - "home-manager": "home-manager_2", + "home-manager": "home-manager", "impermanence": "impermanence", "latest": "latest", "nix-minecraft": "nix-minecraft", - "nixos-hardware": "nixos-hardware_2", + "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_2", "private": "private", "rust-overlay": "rust-overlay", "stable": "stable", @@ -660,7 +501,7 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ] @@ -708,7 +549,7 @@ }, "rust-overlay_3": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "nixpkgs": [ "universe-cli", "nixpkgs" @@ -872,21 +713,6 @@ "repo": "universe-cli", "type": "github" } - }, - "utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index e18cfc3..fb78725 100644 --- a/flake.nix +++ b/flake.nix @@ -34,8 +34,6 @@ impermanence.url = "github:nix-community/impermanence"; - hlissner-dotfiles.url = "github:hlissner/dotfiles"; - flake-registry.url = "github:NixOS/flake-registry"; flake-registry.flake = false; @@ -82,7 +80,6 @@ let libOverlay = (lfinal: lprev: { our = self.lib; - hlissner = inputs.hlissner-dotfiles.lib; hm = inputs.home-manager.lib.hm; }); in diff --git a/lib/default.nix b/lib/default.nix index 55efd46..951e7bf 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -36,4 +36,6 @@ rec { import ./digga.nix { inherit lib; } ) // ( import ./hosts.nix { inherit lib; } +) // ( + import ./options.nix { inherit lib; } )) diff --git a/lib/options.nix b/lib/options.nix new file mode 100644 index 0000000..885b09f --- /dev/null +++ b/lib/options.nix @@ -0,0 +1,18 @@ +# Taken from https://github.com/hlissner/dotfiles/blob/master/lib/options.nix +{ lib }: +let + inherit (lib) mkOption types; +in +{ + mkOpt = type: default: + mkOption { inherit type default; }; + + mkOpt' = type: default: description: + mkOption { inherit type default description; }; + + mkBoolOpt = default: mkOption { + inherit default; + type = types.bool; + example = true; + }; +} diff --git a/modules/functionality/ensure.nix b/modules/functionality/ensure.nix index 47d5eb5..278bc7b 100644 --- a/modules/functionality/ensure.nix +++ b/modules/functionality/ensure.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.services.ensure; in diff --git a/modules/functionality/soft-serve.nix b/modules/functionality/soft-serve.nix index 72a4c7e..635b7cb 100644 --- a/modules/functionality/soft-serve.nix +++ b/modules/functionality/soft-serve.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.services.soft-serve; mkIfNotNull = v: mkIf (v != null) v; diff --git a/modules/global/options.nix b/modules/global/options.nix index 6242c3c..b3603ca 100644 --- a/modules/global/options.nix +++ b/modules/global/options.nix @@ -1,7 +1,7 @@ # Heavily inspired by hlissner: https://github.com/hlissner/dotfiles/blob/master/modules/options.nix { config, options, lib, home-manager, ... }: with lib; -with lib.hlissner; +with lib.our; let mkAliasOpt = mkOpt types.attrs { }; mkInfoOpt = mkOpt types.str ""; diff --git a/modules/modules/boot.nix b/modules/modules/boot.nix index 4411bac..44f3ff3 100644 --- a/modules/modules/boot.nix +++ b/modules/modules/boot.nix @@ -1,6 +1,6 @@ { config, options, lib, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.boot; opt = options.modules.boot; diff --git a/modules/modules/desktop/gaming.nix b/modules/modules/desktop/gaming.nix index 513a54c..336fb66 100644 --- a/modules/modules/desktop/gaming.nix +++ b/modules/modules/desktop/gaming.nix @@ -1,6 +1,6 @@ { config, options, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.desktop.gaming; opt = options.modules.desktop.gaming; diff --git a/modules/modules/desktop/wm.nix b/modules/modules/desktop/wm.nix index 783dbed..39dcf4f 100644 --- a/modules/modules/desktop/wm.nix +++ b/modules/modules/desktop/wm.nix @@ -1,6 +1,6 @@ { pkgs, lib, config, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.desktop.wm; in diff --git a/modules/modules/hardware/audio.nix b/modules/modules/hardware/audio.nix index 8f05844..f74630f 100644 --- a/modules/modules/hardware/audio.nix +++ b/modules/modules/hardware/audio.nix @@ -2,7 +2,7 @@ { options, config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.audio; in diff --git a/modules/modules/hardware/form.nix b/modules/modules/hardware/form.nix index 397bea5..771f1b1 100644 --- a/modules/modules/hardware/form.nix +++ b/modules/modules/hardware/form.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, inputs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.form; in diff --git a/modules/modules/hardware/gpu.nix b/modules/modules/hardware/gpu.nix index 62236b0..03a80dd 100644 --- a/modules/modules/hardware/gpu.nix +++ b/modules/modules/hardware/gpu.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.gpu; any' = any (v: v); diff --git a/modules/modules/hardware/peripherals/fprint-sensor.nix b/modules/modules/hardware/peripherals/fprint-sensor.nix index 0fe8c96..4ec7efa 100644 --- a/modules/modules/hardware/peripherals/fprint-sensor.nix +++ b/modules/modules/hardware/peripherals/fprint-sensor.nix @@ -1,6 +1,6 @@ { config, options, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.peripherals.fprint-sensor; in diff --git a/modules/modules/hardware/peripherals/printing.nix b/modules/modules/hardware/peripherals/printing.nix index 6ae2fbd..793fb8f 100644 --- a/modules/modules/hardware/peripherals/printing.nix +++ b/modules/modules/hardware/peripherals/printing.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.peripherals.printing; in diff --git a/modules/modules/hardware/peripherals/razer.nix b/modules/modules/hardware/peripherals/razer.nix index 39ce39c..bd82703 100644 --- a/modules/modules/hardware/peripherals/razer.nix +++ b/modules/modules/hardware/peripherals/razer.nix @@ -2,7 +2,7 @@ { options, config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.peripherals.razer; in { diff --git a/modules/modules/hardware/wireless.nix b/modules/modules/hardware/wireless.nix index 1cb2143..137116b 100644 --- a/modules/modules/hardware/wireless.nix +++ b/modules/modules/hardware/wireless.nix @@ -1,6 +1,6 @@ { config, lib, private, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.hardware.wireless; in diff --git a/modules/modules/locale.nix b/modules/modules/locale.nix index adf892f..e956144 100644 --- a/modules/modules/locale.nix +++ b/modules/modules/locale.nix @@ -1,6 +1,6 @@ { config, options, lib, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.locale; opt = options.modules.locale; diff --git a/modules/modules/services/apcupsd.nix b/modules/modules/services/apcupsd.nix index 365ee5a..9ab334d 100644 --- a/modules/modules/services/apcupsd.nix +++ b/modules/modules/services/apcupsd.nix @@ -1,6 +1,6 @@ { config, options, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.services.apcupsd; port = 3551; diff --git a/modules/modules/services/foldingathome.nix b/modules/modules/services/foldingathome.nix index 24d99ac..556d64c 100644 --- a/modules/modules/services/foldingathome.nix +++ b/modules/modules/services/foldingathome.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.services.foldingathome; in diff --git a/modules/modules/services/proxy.nix b/modules/modules/services/proxy.nix index dccc023..c211e14 100644 --- a/modules/modules/services/proxy.nix +++ b/modules/modules/services/proxy.nix @@ -1,6 +1,6 @@ { config, options, lib, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.services.proxy; in diff --git a/modules/modules/software/console.nix b/modules/modules/software/console.nix index 3dce6e8..1e43a62 100644 --- a/modules/modules/software/console.nix +++ b/modules/modules/software/console.nix @@ -1,6 +1,6 @@ { config, options, lib, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.software.console; opt = options.modules.software.console; diff --git a/modules/modules/software/minipro.nix b/modules/modules/software/minipro.nix index ecc705a..5343c58 100644 --- a/modules/modules/software/minipro.nix +++ b/modules/modules/software/minipro.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.software.minipro; in diff --git a/modules/modules/software/steam.nix b/modules/modules/software/steam.nix index 4203dea..343224f 100644 --- a/modules/modules/software/steam.nix +++ b/modules/modules/software/steam.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.software.steam; diff --git a/modules/modules/virtualization.nix b/modules/modules/virtualization.nix index aa7c923..2237b8a 100644 --- a/modules/modules/virtualization.nix +++ b/modules/modules/virtualization.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: with lib; -with lib.hlissner; +with lib.our; let cfg = config.modules.virtualization; in diff --git a/secrets/default.nix b/secrets/default.nix index 0a6e0da..07e3455 100644 --- a/secrets/default.nix +++ b/secrets/default.nix @@ -7,7 +7,7 @@ let secrets = lib.mapAttrs' (n: v: lib.nameValuePair (lib.removeSuffix ".age" n) { file = toFile n; }) filtered; in { - options.modules.secrets.enable = lib.hlissner.mkOpt lib.types.bool true; + options.modules.secrets.enable = lib.our.mkOpt lib.types.bool true; config.age.secrets = lib.mkIf config.modules.secrets.enable secrets; }