Re-add flake-utils

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-01-15 11:07:26 +00:00
parent c193ff9e5b
commit 6b366fc24a
4 changed files with 76 additions and 23 deletions

34
flake.lock generated
View File

@@ -119,6 +119,24 @@
"type": "github" "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"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -197,6 +215,7 @@
"ags": "ags", "ags": "ags",
"astal": "astal_2", "astal": "astal_2",
"disko": "disko", "disko": "disko",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur", "nur": "nur",
@@ -245,6 +264,21 @@
"type": "github" "type": "github"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View File

@@ -59,43 +59,52 @@
url = "github:Gerg-L/spicetify-nix"; url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils = {
url = "github:numtide/flake-utils";
};
}; };
outputs = outputs =
{ self, nixpkgs, ... }@inputs: { self, nixpkgs, ... }@inputs:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in
{ {
nixosConfigurations = { nixosConfigurations = {
installer = nixpkgs.lib.nixosSystem { installer = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs; };
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/installer ]; modules = [ ./hosts/installer ];
specialArgs = { inherit inputs system; };
}; };
eirene = nixpkgs.lib.nixosSystem { eirene = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs; };
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/eirene ]; modules = [ ./hosts/eirene ];
specialArgs = { inherit inputs system; };
}; };
elara = nixpkgs.lib.nixosSystem { elara = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs; };
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ ./hosts/elara ]; modules = [ ./hosts/elara ];
specialArgs = { inherit inputs system; };
}; };
}; };
}
// inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells = {
bun = import ./hosts/common/shells/bun { inherit pkgs; };
go = import ./hosts/common/shells/go { inherit pkgs; };
java = import ./hosts/common/shells/java { inherit pkgs; };
nix = import ./hosts/common/shells/nix { inherit pkgs; };
nodejs = import ./hosts/common/shells/nodejs { inherit pkgs; };
python = import ./hosts/common/shells/python { inherit pkgs; };
};
devShells = { formatter = pkgs.nixfmt-rfc-style;
bun = import ./hosts/common/shells/bun { inherit pkgs; }; }
go = import ./hosts/common/shells/go { inherit pkgs; }; );
java = import ./hosts/common/shells/java { inherit pkgs; };
nix = import ./hosts/common/shells/nix { inherit pkgs; };
nodejs = import ./hosts/common/shells/nodejs { inherit pkgs; };
python = import ./hosts/common/shells/python { inherit pkgs; };
};
formatter."x86_64-linux" = pkgs.nixfmt-rfc-style;
};
} }

View File

@@ -2,7 +2,12 @@
user ? throw "user argument is required", user ? throw "user argument is required",
home ? throw "home argument is required", home ? throw "home argument is required",
}: }:
{ lib, inputs, ... }: {
lib,
inputs,
system,
...
}:
{ {
home-manager.users.${user}.programs.zsh = { home-manager.users.${user}.programs.zsh = {
shellAliases.nd = "nix-develop"; shellAliases.nd = "nix-develop";
@@ -10,7 +15,7 @@
initExtra = initExtra =
let let
devShells = lib.strings.concatStringsSep " " ( devShells = lib.strings.concatStringsSep " " (
lib.attrsets.mapAttrsToList (key: _: key) inputs.self.devShells lib.attrsets.mapAttrsToList (key: _: key) inputs.self.devShells.${system}
); );
in in
'' ''

View File

@@ -2,7 +2,12 @@
user ? throw "user argument is required", user ? throw "user argument is required",
home ? throw "home argument is required", home ? throw "home argument is required",
}: }:
{ lib, inputs, ... }: {
lib,
inputs,
system,
...
}:
{ {
home-manager.users.${user} = { home-manager.users.${user} = {
programs = { programs = {
@@ -19,7 +24,7 @@
initExtra = initExtra =
let let
devShells = lib.strings.concatStringsSep " " ( devShells = lib.strings.concatStringsSep " " (
lib.attrsets.mapAttrsToList (key: _: key) inputs.self.devShells lib.attrsets.mapAttrsToList (key: _: key) inputs.self.devShells.${system}
); );
in in
'' ''