summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2023-08-27 14:00:52 +0200
committerquentin@aristote.fr <quentin@aristote.fr>2023-08-27 16:31:26 +0200
commit2296a9c3d51ff7d9db1edb6e65376df21f485486 (patch)
treefeb41140559291d8334f2485fba8f2e1b2d9fb28
parentde6dfea61b996c5e52a47842b3b54e1b9a390a91 (diff)
flake: fix packages output type
-rw-r--r--flake.lock18
-rw-r--r--flake.nix47
-rw-r--r--pkgs/static/gitignore/default.nix1
3 files changed, 42 insertions, 24 deletions
diff --git a/flake.lock b/flake.lock
index 7f0b1ab..0c60060 100644
--- a/flake.lock
+++ b/flake.lock
@@ -136,11 +136,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1693028636,
- "narHash": "sha256-WOG42JO/yyvgYK3jQktDEy2qtZI7R+s3Lo4Y9gBr6XM=",
+ "lastModified": 1693060755,
+ "narHash": "sha256-KNsbfqewEziFJEpPR0qvVz4rx0x6QXxw1CcunRhlFdk=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "e61ea96d43505ba0d2c066134eb9d67cadfddce7",
+ "rev": "c66ccfa00c643751da2fd9290e096ceaa30493fc",
"type": "github"
},
"original": {
@@ -202,11 +202,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1692808169,
- "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=",
+ "lastModified": 1693060755,
+ "narHash": "sha256-KNsbfqewEziFJEpPR0qvVz4rx0x6QXxw1CcunRhlFdk=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "9201b5ff357e781bf014d0330d18555695df7ba8",
+ "rev": "c66ccfa00c643751da2fd9290e096ceaa30493fc",
"type": "github"
},
"original": {
@@ -216,11 +216,11 @@
},
"nur": {
"locked": {
- "lastModified": 1692895597,
- "narHash": "sha256-DqrtJx1N69km/PqtBb0OVubu7ORtmvQJILSNlVwfMgU=",
+ "lastModified": 1693136796,
+ "narHash": "sha256-JXSewQ7qKBN4D8MMpnAarASnSAravfbETEwxDDi8on8=",
"owner": "nix-community",
"repo": "NUR",
- "rev": "48fce8d1a2576b92d067e7ffd05d60c12ab6eaa0",
+ "rev": "33b4841fe111b93d6a67e0585f6d60b4621e0ae7",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index 6226ca7..76e6291 100644
--- a/flake.nix
+++ b/flake.nix
@@ -25,7 +25,18 @@
devenvModules.personal = import ./modules/devenv;
nixosModules.personal = import ./modules/nixos;
homeModules.personal = import ./modules/home-manager;
- overlays.personal = self.overlays.default;
+ overlays.personal = _: super: let
+ my-packages = import ./pkgs super;
+ in {
+ inherit
+ (super.lib.recursiveUpdate super {
+ personal = my-packages;
+ lib.personal = my-packages.lib;
+ })
+ personal
+ lib
+ ;
+ };
lib = import ./lib;
@@ -53,28 +64,34 @@
pkgs,
lib,
...
- }: {
+ }: let
+ flatten = let
+ aux = path: attrs:
+ if lib.isAttrs attrs && ! lib.isDerivation attrs
+ then lib.foldlAttrs (prev: name: value: prev // aux (path ++ [name]) value) {} attrs
+ else
+ (
+ if lib.isDerivation attrs
+ then {"${lib.concatStringsSep "_" path}" = attrs;}
+ else {}
+ );
+ in
+ aux [];
+ in {
_module.args.pkgs = import nixpkgs {
inherit system;
- overlays = [nur.overlay];
+ overlays = [nur.overlay self.overlays.personal];
config = {};
};
- overlayAttrs = {
- inherit
- (lib.recursiveUpdate pkgs {
- personal = config.packages;
- lib.personal = config.packages.lib;
- })
- personal
- lib
- ;
- };
- packages = import ./pkgs pkgs;
+ packages = flatten pkgs.personal;
devenv.shells.default = {
imports = [self.devenvModules.personal];
- languages.nix.enable = true;
+ languages.nix = {
+ enable = true;
+ packaging.enable = true;
+ };
};
};
};
diff --git a/pkgs/static/gitignore/default.nix b/pkgs/static/gitignore/default.nix
index 67dd28a..94b3702 100644
--- a/pkgs/static/gitignore/default.nix
+++ b/pkgs/static/gitignore/default.nix
@@ -22,6 +22,7 @@ stdenvNoCC.mkDerivation {
do
echo "### $(basename "$file" .gitignore)" >> $out
cat "$file" >> $out
+ echo >> $out
done
substituteInPlace $out ${lib.concatStringsSep " " (builtins.map (line: "--replace ${lib.escapeShellArg "# ${line}"} ${lib.escapeShellArg line}") toUncomment)}
'';