Compare commits

...

2 Commits

Author SHA1 Message Date
10930e85d6 Use overlay
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-08-17 19:57:22 +03:00
37d2ba1946 Add envrc
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-08-17 19:57:12 +03:00
10 changed files with 27 additions and 40 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake self#nix

View File

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

View File

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

View File

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

View File

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

View File

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

13
overlays/default.nix Normal file
View File

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

View File

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

View File

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