dotfiles

My PC Dotfiles & Website
commit affe1ee50b1d79c718e79cb47e326ec865c7669a
parent 69e078e92de0449b6f0ca35556820ff00546ac4f
Author: maydayv7 <maydayv7@gmail.com>
Date:   Mon, 23 Oct 2023 16:48:30 +0530

fix: Clean up `inputs`

+ Remove `library`, `stable`, rename `unstable` to `nixpkgs`
+ Add `systems.nix` for `flake-utils/systems`
+ Remove `.version`

Diffstat:

D.version | 2--
MREADME.md | 1+
Mconfiguration.nix | 64++++++++++++++++++++++++++++++----------------------------------
Mflake.lock | 127+++++++++++++++++++++++++++++++++++++------------------------------------------
Mflake.nix | 74++++++++++++++++++++++++++++++++++++--------------------------------------
Mlib/build.nix | 4++--
Mlib/default.nix | 2+-
Mmodules/default.nix | 12+++---------
Asystems.nix | 3+++
9 files changed, 136 insertions(+), 153 deletions(-)

diff --git a/.version b/.version @@ -1 +0,0 @@ -23.05 -\ No newline at end of file diff --git a/README.md b/README.md @@ -420,6 +420,7 @@ You can navigate to the `README`'s present in the various directories to know mo - Refactor Secrets - Drop `deploy-rs` Support - Remove `inputs` patching Support +- Fix first boot installation ### 23.05 (v12) diff --git a/configuration.nix b/configuration.nix @@ -1,32 +1,28 @@ -{self, ...} @ inputs: -with inputs; let +{self, ...} @ inputs: let ## Variable Declaration ## # Supported Architectures - platforms = ["x86_64-linux"]; - - # NixOS Version - version = readFile ./.version; + systems = import inputs.systems; # System Libraries inherit (self) files; - inherit (lib) eachSystem filters; inherit (builtins) head readFile; inherit (lib.util) build map pack; - lib = library.lib.extend (final: prev: - { - filters = ignore.lib // {inherit (filter.lib) filter matchExt;}; - hooks = hooks.lib; - image = generators.nixosGenerate; - wine = wine.lib; - util = import ./lib { - inherit self platforms; - lib = final; - }; - } - // home.lib - // utils.lib); + lib = with inputs; + nixpkgs.lib.extend (final: prev: + { + filters = ignore.lib // {inherit (filter.lib) filter matchExt;}; + hooks = hooks.lib; + image = generators.nixosGenerate; + wine = wine.lib; + util = import ./lib { + inherit self systems; + lib = final; + }; + } + // home.lib + // utils.lib); in - eachSystem platforms (system: let + lib.eachSystem systems (system: let # Default Package Channel pkgs = self.legacyPackages."${system}"; @@ -50,12 +46,11 @@ in formatter = pkgs.treefmt; ## Package Configuration ## - legacyPackages = self.channels."${system}".unstable; + legacyPackages = self.channels."${system}".nixpkgs; # Channels - channels = { - stable = (build.channel stable [])."${system}"; - unstable = (build.channel unstable [nur.overlay])."${system}"; + channels = with inputs; { + nixpkgs = (build.channel nixpkgs [nur.overlay])."${system}"; wine = wine.packages."${system}"; gaming = gaming.packages."${system}"; apps.generators = generators.packages."${system}".default; @@ -67,9 +62,11 @@ in map.modules ./packages call // map.modules ./scripts call // {default = self.packages."${system}".dotfiles;} - // proprietary.packages."${system}"; + // inputs.proprietary.packages."${system}"; }) - // { + // (let + defaultPkgs = self.legacyPackages."${head systems}"; + in { # Overrides overlays = map.modules ./packages/overlays import; @@ -77,17 +74,17 @@ in lib = lib.util // { - inherit platforms; - nixpkgs = library.lib; + inherit systems; + nixpkgs = inputs.nixpkgs.lib; }; ## Program Configuration and 'dotfiles' ## - files = import ./files lib inputs self.legacyPackages."${head platforms}"; + files = import ./files lib inputs defaultPkgs; ## Custom Configuration Modules ## nixosModules = map.modules ./modules import - // {default = import ./modules {inherit version lib inputs files;};}; + // {default = import ./modules {inherit lib inputs files;};}; ## Configuration Templates ## templates = import ./.templates lib; @@ -98,8 +95,7 @@ in ## Virtual Machines ## vmConfigurations = - map.modules ./devices/vm (name: - import name windows.lib self.channels."${head platforms}".stable); + map.modules ./devices/vm (name: import name inputs.windows.lib defaultPkgs); ## Install Media Configuration ## installMedia = { @@ -119,4 +115,4 @@ in gui.desktop = "xfce"; }; }; - } + }) diff --git a/flake.lock b/flake.lock @@ -213,7 +213,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1694529238, @@ -301,7 +301,7 @@ "home": { "inputs": { "nixpkgs": [ - "unstable" + "nixpkgs" ] }, "locked": { @@ -329,11 +329,9 @@ "ignore" ], "nixpkgs": [ - "unstable" + "nixpkgs" ], - "nixpkgs-stable": [ - "stable" - ] + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { "lastModified": 1695576016, @@ -352,7 +350,7 @@ "ignore": { "inputs": { "nixpkgs": [ - "stable" + "nixpkgs" ] }, "locked": { @@ -387,7 +385,7 @@ "index": { "inputs": { "nixpkgs": [ - "stable" + "nixpkgs" ] }, "locked": { @@ -404,23 +402,6 @@ "type": "github" } }, - "library": { - "locked": { - "lastModified": 1694911725, - "narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "819180647f428a3826bfc917a54449da1e532ce0", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "nixpkgs.lib", - "rev": "819180647f428a3826bfc917a54449da1e532ce0", - "type": "github" - } - }, "nixlib": { "locked": { "lastModified": 1693701915, @@ -472,6 +453,22 @@ }, "nixpkgs-stable": { "locked": { + "lastModified": 1697851979, + "narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5550a85a087c04ddcace7f892b0bdc9d8bb080c8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { "lastModified": 1694908564, "narHash": "sha256-ducA98AuWWJu5oUElIzN24Q22WlO8bOfixGzBgzYdVc=", "owner": "NixOS", @@ -504,6 +501,22 @@ }, "nixpkgs_3": { "locked": { + "lastModified": 1697723726, + "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { "lastModified": 1696484316, "narHash": "sha256-LE7F+Wrvo1B8OR3E1bITYAcfBaNKXLHqBrXoZEtqrTQ=", "owner": "nixos", @@ -517,7 +530,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1694760568, "narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=", @@ -550,7 +563,7 @@ }, "proprietary": { "inputs": { - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "utils": "utils" }, "locked": { @@ -578,13 +591,12 @@ "ignore": "ignore", "impermanence": "impermanence", "index": "index", - "library": "library", + "nixpkgs": "nixpkgs_3", "nur": "nur", "proprietary": "proprietary", "sops": "sops", - "stable": "stable", "stylix": "stylix", - "unstable": "unstable", + "systems": "systems_2", "utils": "utils_2", "windows": "windows", "wine": "wine" @@ -592,8 +604,8 @@ }, "sops": { "inputs": { - "nixpkgs": "nixpkgs_4", - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs": "nixpkgs_5", + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1695284550, @@ -609,22 +621,6 @@ "type": "github" } }, - "stable": { - "locked": { - "lastModified": 1695825837, - "narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, "stylix": { "inputs": { "base16": "base16", @@ -640,7 +636,7 @@ "home" ], "nixpkgs": [ - "unstable" + "nixpkgs" ] }, "locked": { @@ -673,6 +669,19 @@ } }, "systems_2": { + "flake": false, + "locked": { + "lastModified": 1, + "narHash": "sha256-yJg569/Wc8hgG64XgA72/nLsZthk+InI5N+Hhmcc+kA=", + "path": "./systems.nix", + "type": "path" + }, + "original": { + "path": "./systems.nix", + "type": "path" + } + }, + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -687,22 +696,6 @@ "type": "github" } }, - "unstable": { - "locked": { - "lastModified": 1697456312, - "narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ca012a02bf8327be9e488546faecae5e05d7d749", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "utils": { "inputs": { "systems": "systems" @@ -742,7 +735,7 @@ "windows": { "inputs": { "nixpkgs": [ - "stable" + "nixpkgs" ] }, "locked": { @@ -763,7 +756,7 @@ "inputs": { "flake-compat": "flake-compat_3", "nixpkgs": [ - "unstable" + "nixpkgs" ] }, "locked": { diff --git a/flake.nix b/flake.nix @@ -23,7 +23,7 @@ # Author -> V 7 <maydayv7@gmail.com> # # License -> MIT # # URL -> github:maydayv7/dotfiles # -# Version -> unstable (v13) # +# Version -> v13 # # --------------------------------------- # # Welcome to Ground Zero! # # The Very Heart of my 'dotfiles' # @@ -62,11 +62,8 @@ ## System Repositories ## inputs = { ## Package Repositories ## - # NixOS Stable Release - stable.url = "github:NixOS/nixpkgs?ref=nixos-23.05"; - - # Unstable Packages Repository - unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; + # NixOS Packages Repository + nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; # Nix User Repository nur.url = "github:nix-community/NUR"; @@ -78,32 +75,42 @@ gaming.url = "github:fufexan/nix-gaming"; ## Configuration Modules ## - # Nix Library Functions - library = { - type = "github"; - owner = "nix-community"; - repo = "nixpkgs.lib"; - ref = "master"; - rev = "819180647f428a3826bfc917a54449da1e532ce0"; + ## Language Addendum + # Supported Architectures + systems = { + url = "path:./systems.nix"; + flake = false; }; - # User Home Manager - home = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "unstable"; + # Flake Utility Functions + utils = { + url = "github:gytis-ivaskevicius/flake-utils-plus"; + inputs.flake-utils.inputs.systems.follows = "systems"; }; # Source Filter Functions filter.url = "github:numtide/nix-filter"; ignore = { url = "github:hercules-ci/gitignore.nix"; - inputs.nixpkgs.follows = "stable"; + inputs.nixpkgs.follows = "nixpkgs"; }; - # Flake Utility Functions - utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; + # Pre-Commit Hooks + hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "utils/flake-utils"; + inputs.gitignore.follows = "ignore"; + }; + + ## Feature Modules + # User Home Manager + home = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - # PC Hardware Module + # Hardware Support hardware.url = "github:nixos/nixos-hardware"; # Authentication Credentials Manager @@ -115,38 +122,29 @@ # System Image Generators generators.url = "github:nix-community/nixos-generators"; - # Base16 Theming - stylix = { - url = "github:danth/stylix"; - inputs.nixpkgs.follows = "unstable"; - inputs.home-manager.follows = "home"; - }; - # Nix Index Database index = { url = "github:Mic92/nix-index-database"; - inputs.nixpkgs.follows = "stable"; + inputs.nixpkgs.follows = "nixpkgs"; }; - # Pre-Commit Hooks - hooks = { - url = "github:cachix/pre-commit-hooks.nix"; - inputs.nixpkgs.follows = "unstable"; - inputs.nixpkgs-stable.follows = "stable"; - inputs.flake-utils.follows = "utils/flake-utils"; - inputs.gitignore.follows = "ignore"; + # Base16 Theming + stylix = { + url = "github:danth/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home"; }; # Windows VM Creator windows = { url = "git+https://git.m-labs.hk/M-Labs/wfvm"; - inputs.nixpkgs.follows = "stable"; + inputs.nixpkgs.follows = "nixpkgs"; }; # Wine Apps Wrapper wine = { url = "github:emmanuelrosa/erosanix"; - inputs.nixpkgs.follows = "unstable"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/lib/build.nix b/lib/build.nix @@ -1,6 +1,6 @@ { self, - platforms, + systems, lib, ... }: let @@ -33,7 +33,7 @@ in rec { # Package Channels Builder channel = src: overlays: - each platforms (system: let + each systems (system: let pkgs = src.legacyPackages."${system}"; in import src { diff --git a/lib/default.nix b/lib/default.nix @@ -1,6 +1,6 @@ { self, - platforms, + systems, lib, } @ args: let inherit (lib) makeExtensible attrValues foldr; diff --git a/modules/default.nix b/modules/default.nix @@ -1,15 +1,12 @@ { - version, lib, inputs, files, }: let inherit (inputs) self generators; - inherit (lib) extend makeOverridable mkForce mkIf; + inherit (lib) extend fileContents makeOverridable mkIf; inherit (builtins) - any - attrNames attrValues getAttr hashString @@ -39,13 +36,12 @@ in { users ? null, }: let # Default Package Channel - input = inputs.unstable; pkgs = self.legacyPackages."${system}"; # System Libraries inherit (lib') util; lib' = - extend (final: prev: with input.lib; {inherit nixosSystem trivial;}); + extend (final: prev: with inputs.nixpkgs.lib; {inherit nixosSystem trivial;}); # User Build Function user' = { @@ -129,8 +125,6 @@ in { nix = { settings.max-jobs = hardware.cores or 4; index = mkIf (update == "") true; - nixPath = ["nixpkgs=${input}"]; - registry.nixpkgs.flake = mkForce input; }; system = { @@ -142,7 +136,7 @@ in { }; # Version - stateVersion = version; + stateVersion = fileContents "${inputs.nixpkgs}/.version"; configurationRevision = if (self ? rev) then self.rev diff --git a/systems.nix b/systems.nix @@ -0,0 +1,3 @@ +[ + "x86_64-linux" +]