Compare commits

..

1 Commits

Author SHA1 Message Date
00d04c73f6 Add envrc
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-08-17 12:48:00 +03:00
9 changed files with 40 additions and 26 deletions

View File

@@ -10,22 +10,20 @@
outputs = outputs =
inputs: inputs:
{ (
overlays.default = import ./overlays;
}
// (
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
overlays = [ inputs.self.overlays.default ];
}; };
treefmt = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix; treefmt = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in in
{ {
lib.${system} = import ./lib { inherit pkgs; };
formatter.${system} = treefmt.config.build.wrapper; formatter.${system} = treefmt.config.build.wrapper;
checks.${system}.formatting = treefmt.config.build.check inputs.self; checks.${system}.formatting = treefmt.config.build.check inputs.self;
} }

8
lib/default.nix Normal file
View File

@@ -0,0 +1,8 @@
{ pkgs, ... }:
let
callPackage = pkgs.lib.callPackageWith { inherit pkgs; };
in
{
fetchers = callPackage ./fetchers { };
runtime = callPackage ./runtime { };
}

7
lib/fetchers/default.nix Normal file
View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
let
callPackage = pkgs.lib.callPackageWith { inherit pkgs; };
in
{
sshKnownHosts = callPackage ./sshKnownHosts { };
}

View File

@@ -1,5 +1,5 @@
final: prev: { pkgs, ... }:
prev.lib.fetchers.withNormalizedHash { } ( pkgs.lib.fetchers.withNormalizedHash { } (
{ {
host, host,
name ? "ssh-known-hosts-${host}", name ? "ssh-known-hosts-${host}",
@@ -13,15 +13,15 @@ prev.lib.fetchers.withNormalizedHash { } (
], ],
}: }:
let let
keyTypeArgs = prev.lib.concatStringsSep "," keyTypes; keyTypeArgs = pkgs.lib.concatStringsSep "," keyTypes;
in in
prev.runCommandLocal name pkgs.runCommandLocal name
{ {
inherit outputHash outputHashAlgo; inherit outputHash outputHashAlgo;
outputHashMode = "flat"; outputHashMode = "flat";
preferLocalBuild = true; preferLocalBuild = true;
nativeBuildInputs = with final; [ nativeBuildInputs = with pkgs; [
openssh openssh
gnugrep gnugrep
coreutils coreutils

7
lib/runtime/default.nix Normal file
View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
let
callPackage = pkgs.lib.callPackageWith { inherit pkgs; };
in
{
merge = callPackage ./merge { };
}

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
let
callPackage = pkgs.lib.callPackageWith { inherit pkgs; };
in
{
keyValue = callPackage ./keyValue { };
}

View File

@@ -1,8 +1,8 @@
final: prev: { pkgs, ... }:
"${ "${
prev.writeShellApplication { pkgs.writeShellApplication {
name = "merge-key-value"; name = "merge-key-value";
runtimeInputs = with final; [ runtimeInputs = with pkgs; [
coreutils coreutils
gawk gawk
]; ];

View File

@@ -1,13 +0,0 @@
final: prev: {
lib = prev.lib.recursiveUpdate prev.lib {
fetchers = {
sshKnownHosts = import ./fetchers/sshKnownHosts final prev;
};
runtime = {
merge = {
keyValue = import ./runtime/merge/keyValue final prev;
};
};
};
}