From 5efb7d00a801389ebd4fe3297ab27fef50f66c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Sun, 23 Mar 2025 11:43:37 +0100 Subject: [PATCH] nilla: init --- flake.lock | 34 ++++++++++++++++++++++++++++++++++ flake.nix | 8 ++++++++ inputs.nix | 11 +++++++++++ nilla.nix | 37 +++++++++++++++++++++++++++++++++++++ shell.nix | 1 + 5 files changed, 91 insertions(+) create mode 100644 inputs.nix create mode 100644 nilla.nix create mode 100644 shell.nix diff --git a/flake.lock b/flake.lock index 3cd382a..eb64358 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "__flake-compat": { + "flake": false, + "locked": { + "lastModified": 1742412704, + "narHash": "sha256-mhazLo8DuZ3c6r5I7hDxxag8ftAM4W0aUjFjQuw8q5c=", + "ref": "refs/heads/main", + "rev": "f7a7752f237bbc59b868058f70cffd3e436b49b7", + "revCount": 69, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, "agenix": { "inputs": { "darwin": [ @@ -475,6 +491,22 @@ "type": "github" } }, + "nilla": { + "flake": false, + "locked": { + "lastModified": 1742722370, + "narHash": "sha256-MqdseA78bo2M3zfb0mjcBPYU2Qn9CF/KH5LZivWRtB0=", + "owner": "nilla-nix", + "repo": "nilla", + "rev": "b30b5a225843ab649a9b140eb3cbbcc8030a7eaf", + "type": "github" + }, + "original": { + "owner": "nilla-nix", + "repo": "nilla", + "type": "github" + } + }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -593,6 +625,7 @@ }, "root": { "inputs": { + "__flake-compat": "__flake-compat", "agenix": "agenix", "attic": "attic", "conduit-src": "conduit-src", @@ -608,6 +641,7 @@ "lix-module": "lix-module", "mailserver": "mailserver", "niko-nur": "niko-nur", + "nilla": "nilla", "nixpkgs": "nixpkgs_2", "racket": "racket", "treefmt": "treefmt", diff --git a/flake.nix b/flake.nix index 821117f..e8eaec5 100644 --- a/flake.nix +++ b/flake.nix @@ -168,6 +168,14 @@ url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + __flake-compat = { + url = "git+https://git.lix.systems/lix-project/flake-compat.git"; + flake = false; + }; + nilla = { + url = "github:nilla-nix/nilla"; + flake = false; + }; }; /* diff --git a/inputs.nix b/inputs.nix new file mode 100644 index 0000000..80ba847 --- /dev/null +++ b/inputs.nix @@ -0,0 +1,11 @@ +let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + nodeName = lock.nodes.root.inputs.__flake-compat; + inherit (lock.nodes.${nodeName}.locked) narHash rev url; + flake-compat = builtins.fetchTarball { + url = "${url}/archive/${rev}.tar.gz"; + sha256 = narHash; + }; + flake = import flake-compat { src = ./.; }; +in +flake.inputs diff --git a/nilla.nix b/nilla.nix new file mode 100644 index 0000000..48729f7 --- /dev/null +++ b/nilla.nix @@ -0,0 +1,37 @@ +{ + inputs ? import ./inputs.nix, +}: +(import inputs.nilla).create ( + { lib }: + { + config.inputs = builtins.mapAttrs (_: src: { + inherit src; + loader = "raw"; + }) inputs; + + config.builders.nixpkgs-flake = { + settings.type = lib.types.submodule { + options.args = lib.options.create { + type = lib.types.any; + default.value = { }; + }; + }; + settings.default = { }; + build = + pkg: + lib.attrs.generate pkg.systems ( + system: inputs.nixpkgs.legacyPackages.${system}.callPackage pkg.package pkg.settings.args + ); + }; + + config.shells.default = { + systems = [ "x86_64-linux" ]; + builder = "nixpkgs-flake"; + shell = + { mkShell, hello }: + mkShell { + packages = [ hello ]; + }; + }; + } +) diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..0cb2ef7 --- /dev/null +++ b/shell.nix @@ -0,0 +1 @@ +(import ./nilla.nix { }).shells.default.result.${builtins.currentSystem}