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 =
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;
}

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