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
11 changed files with 40 additions and 65 deletions

View File

@@ -10,23 +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
{
packages.${system} = import ./packages { inherit pkgs; };
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,20 +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;
};
};
};
}
// (import ../packages { pkgs = final; })
// {
dockerImages = prev.dockerImages or { } // {
base = final.docker-image-base;
};
}

View File

@@ -1,4 +0,0 @@
{ pkgs, ... }:
{
docker-image-base = import ./docker/base { inherit pkgs; };
}

View File

@@ -1,27 +0,0 @@
{ pkgs, ... }:
pkgs.dockerTools.buildImage {
name = "base";
copyToRoot = pkgs.buildEnv {
name = "root";
paths = with pkgs; [
dockerTools.usrBinEnv
dockerTools.binSh
dockerTools.caCertificates
bashInteractive
busybox
];
pathsToLink = [
"/bin"
"/lib"
"/share"
"/etc"
"/usr"
];
};
runAsRoot = ''
${pkgs.dockerTools.shadowSetup}
mkdir -p /tmp
'';
}