diff --git a/flake.lock b/flake.lock index 53adfc6..60ad441 100644 --- a/flake.lock +++ b/flake.lock @@ -132,6 +132,24 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "neovim-nightly-overlay", @@ -152,7 +170,7 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -173,24 +191,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "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" - } - }, "fromYaml": { "flake": false, "locked": { @@ -295,7 +295,7 @@ }, "neovim-nightly-overlay": { "inputs": { - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "neovim-src": "neovim-src", "nixpkgs": "nixpkgs" }, @@ -361,6 +361,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-master": { "locked": { "lastModified": 1774515149, @@ -476,7 +491,7 @@ "root": { "inputs": { "assets": "assets", - "flake-utils": "flake-utils", + "flake-parts": "flake-parts", "home-manager": "home-manager", "lanzaboote": "lanzaboote", "neovim-nightly-overlay": "neovim-nightly-overlay", @@ -516,13 +531,13 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" ], "nur": "nur", - "systems": "systems_2", + "systems": "systems", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -559,21 +574,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tinted-foot": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index f678e0f..10563d7 100644 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,6 @@ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-master.url = "github:nixos/nixpkgs/master"; - # dotfiles = { - # url = "git+https://git.janezic.dev/janezicmatej/.dotfiles.git"; - # flake = false; - # }; nvim = { url = "git+https://git.janezic.dev/janezicmatej/nvim.git"; flake = false; @@ -17,7 +13,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - flake-utils.url = "github:numtide/flake-utils"; + flake-parts.url = "github:hercules-ci/flake-parts"; home-manager = { url = "github:nix-community/home-manager/release-25.11"; @@ -40,118 +36,115 @@ }; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; - }; outputs = - inputs@{ - nixpkgs, - flake-utils, - ... - }: + inputs@{ flake-parts, nixpkgs, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" ]; - let - my-lib = import ./lib { inherit (nixpkgs) lib; }; + perSystem = + { system, pkgs, ... }: + let + my-lib = import ./lib { inherit (nixpkgs) lib; }; + in + { + packages = + import ./packages + { + inherit my-lib; + inherit (nixpkgs) lib; + } + { + inherit pkgs; + pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; + pkgs-master = inputs.nixpkgs-master.legacyPackages.${system}; + }; - overlays = [ - ( - _: prev: - let - pkgs-unstable = import inputs.nixpkgs-unstable { - inherit (prev.stdenv.hostPlatform) system; - inherit (prev) config; - }; - pkgs-master = import inputs.nixpkgs-master { - inherit (prev.stdenv.hostPlatform) system; - inherit (prev) config; - }; - in - { - inherit (pkgs-master) claude-code; - # TODO:(@janezicmatej) 2026-03-09 error with stable for telegram-desktop - inherit (pkgs-unstable) telegram-desktop; - } - ) - ]; + formatter = pkgs.nixfmt-tree; - mkHost = my-lib.mkHost { - inherit - nixpkgs - overlays - inputs - ; - }; - - in - - { - lib = my-lib; - - nixosConfigurations = { - fw16 = mkHost "fw16" { - system = "x86_64-linux"; - user = "matej"; - }; - tower = mkHost "tower" { - system = "x86_64-linux"; - user = "matej"; + devShells.default = pkgs.mkShell { + packages = [ + pkgs.pre-commit + pkgs.statix + pkgs.shellcheck + pkgs.shfmt + pkgs.qemu + ]; + }; }; - # nixos-rebuild build-image --image-variant install-iso --flake .#iso - iso = mkHost "iso" { - system = "x86_64-linux"; - }; + flake = + let + my-lib = import ./lib { inherit (nixpkgs) lib; }; - ephvm = mkHost "ephvm" { - system = "x86_64-linux"; - user = "matej"; - }; - }; - - nixosModules = import ./modules/nixos { - inherit my-lib; - inherit (nixpkgs) lib; - } { }; - - homeManagerModules = import ./modules/home-manager { - inherit my-lib; - inherit (nixpkgs) lib; - } { }; - - nixosProfiles = import ./profiles { - inherit my-lib; - inherit (nixpkgs) lib; - } { }; - } - // flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - packages = - import ./packages - { - inherit my-lib; - inherit (nixpkgs) lib; - } - { - pkgs = nixpkgs.legacyPackages.${system}; - pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system}; - pkgs-master = inputs.nixpkgs-master.legacyPackages.${system}; - }; - - formatter = pkgs.nixfmt-tree; - - devShells.default = pkgs.mkShell { - packages = [ - pkgs.pre-commit - pkgs.statix - pkgs.shellcheck - pkgs.shfmt - pkgs.qemu + overlays = [ + ( + _: prev: + let + pkgs-unstable = import inputs.nixpkgs-unstable { + inherit (prev.stdenv.hostPlatform) system; + inherit (prev) config; + }; + pkgs-master = import inputs.nixpkgs-master { + inherit (prev.stdenv.hostPlatform) system; + inherit (prev) config; + }; + in + { + inherit (pkgs-master) claude-code; + # TODO:(@janezicmatej) 2026-03-09 error with stable for telegram-desktop + inherit (pkgs-unstable) telegram-desktop; + } + ) ]; + + mkHost = my-lib.mkHost { + inherit + nixpkgs + overlays + inputs + ; + }; + in + { + lib = my-lib; + + nixosConfigurations = { + fw16 = mkHost "fw16" { + system = "x86_64-linux"; + user = "matej"; + }; + tower = mkHost "tower" { + system = "x86_64-linux"; + user = "matej"; + }; + + # nixos-rebuild build-image --image-variant install-iso --flake .#iso + iso = mkHost "iso" { + system = "x86_64-linux"; + }; + + ephvm = mkHost "ephvm" { + system = "x86_64-linux"; + user = "matej"; + }; + }; + + nixosModules = import ./modules/nixos { + inherit my-lib; + inherit (nixpkgs) lib; + } { }; + + homeManagerModules = import ./modules/home-manager { + inherit my-lib; + inherit (nixpkgs) lib; + } { }; + + nixosProfiles = import ./profiles { + inherit my-lib; + inherit (nixpkgs) lib; + } { }; }; - } - ); + }; }