diff --git a/flake.lock b/flake.lock index 873d3e56..e38a909c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1730200266, @@ -16,8 +34,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + } + }, "root": { "inputs": { + "flake-parts": "flake-parts", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 30803cbe..927e2f19 100644 --- a/flake.nix +++ b/flake.nix @@ -1,31 +1,48 @@ { description = "Consequence of allowing autistic people on the internet. Stay mad one-proper-config-structure purists :3"; - outputs = {nixpkgs, ...} @ inputs: let - pkgs = nixpkgs.legacyPackages.x86_64-linux; - theme = import ./theme; - user = import ./user { - inherit pkgs theme; - }; - in { - nixosConfigurations = import ./hosts inputs; - nixosModules = - { - # This module is not meant to be imported by anyone but me - # it's just so I can easily avoid ../../../../../ mess - system = import ./system; + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + flake = { + nixosModules = + { + # This module is not meant to be imported by anyone but me + # it's just so I can easily avoid ../../../../../ mess + system = import ./system; - user = user.module; + user = let + theme = import ./theme; + user = import ./user {inherit theme;}; + in + user.module; - # place for my home brew modules - } - // import ./modules; + # place for my home brew modules + } + // import ./modules; + nixosConfigurations = import ./hosts inputs; + }; + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + perSystem = {pkgs, ...}: let + theme = import ./theme; + user = import ./user { + inherit pkgs theme; + }; + in { + formatter = pkgs.alejandra; + packages = user.packages; + devShells.default = user.shell; + }; + }; - inherit theme; - packages.x86_64-linux = user.packages; - formatter.x86_64-linux = pkgs.alejandra; - devShells.x86_64-linux.default = user.shell; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + apple-silicon-support = { + url = "github:tpwrules/nixos-apple-silicon"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; }