From a461f575f81847cf28e0ec717edd7858069f61d2 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sun, 7 Dec 2025 11:37:17 +0200 Subject: [PATCH] feat: initialize the dendritic pattern --- README.md | 3 ++ flake.lock | 75 ++++++++++++++++++++++-------------- flake.nix | 48 ++++++----------------- modules/flake/pre-commit.nix | 25 ++++++++++++ modules/flake/systems.nix | 6 +++ 5 files changed, 93 insertions(+), 64 deletions(-) create mode 100644 modules/flake/pre-commit.nix create mode 100644 modules/flake/systems.nix diff --git a/README.md b/README.md index 8f93eef..83f1772 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,6 @@ In-progress unification of my various NixOS configs with shared modules. ## Related * Neovim configuration flake: [~liljamo/nvim-flake](https://git.src.quest/~liljamo/nvim-flake) + +## Structure +* [The Dendritic Pattern](https://github.com/mightyiam/dendritic) diff --git a/flake.lock b/flake.lock index e189c0f..088a94d 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1761588595, + "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", "type": "github" }, "original": { @@ -38,14 +38,16 @@ "inputs": { "flake-compat": "flake-compat", "gitignore": "gitignore", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs-unstable" + ] }, "locked": { - "lastModified": 1742649964, - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "lastModified": 1765016596, + "narHash": "sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "rev": "548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c", "type": "github" }, "original": { @@ -75,29 +77,28 @@ "type": "github" } }, - "nixpkgs": { + "import-tree": { "locked": { - "lastModified": 1730768919, - "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "lastModified": 1763762820, + "narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=", + "owner": "vic", + "repo": "import-tree", + "rev": "3c23749d8013ec6daa1d7255057590e9ca726646", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "vic", + "repo": "import-tree", "type": "github" } }, "nixpkgs-lib": { "locked": { - "lastModified": 1743296961, - "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", "type": "github" }, "original": { @@ -106,18 +107,34 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs-stable": { + "locked": { + "lastModified": 1764831616, + "narHash": "sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c97c47f2bac4fa59e2cbdeba289686ae615f8ed4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { "locked": { - "lastModified": 1744868846, - "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", + "lastModified": 1764950072, + "narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c", + "rev": "f61125a668a320878494449750330ca58b78c557", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -126,7 +143,9 @@ "inputs": { "flake-parts": "flake-parts", "git-hooks": "git-hooks", - "nixpkgs": "nixpkgs_2" + "import-tree": "import-tree", + "nixpkgs-stable": "nixpkgs-stable", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 93c28ff..7d1e7ba 100644 --- a/flake.nix +++ b/flake.nix @@ -1,44 +1,20 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - + # Flake management flake-parts.url = "github:hercules-ci/flake-parts"; + import-tree.url = "github:vic/import-tree"; + + # nixpkgs + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11"; + + # Pre-commit git-hooks.url = "github:cachix/git-hooks.nix"; + git-hooks.inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - outputs = inputs @ { - self, - nixpkgs, - flake-parts, - git-hooks, - }: - flake-parts.lib.mkFlake { + outputs = inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; - } { - systems = ["x86_64-linux"]; - perSystem = { - pkgs, - system, - ... - }: { - checks.pre-commit-check = git-hooks.lib.${system}.run { - src = ./.; - hooks = { - alejandra = { - enable = true; - }; - }; - }; - - devShells.default = pkgs.mkShell { - inherit (self.checks.${system}.pre-commit-check) shellHook; - buildInputs = with pkgs; - [ - nix-diff - sops - ] - ++ self.checks.${system}.pre-commit-check.enabledPackages; - }; - }; - }; + } (inputs.import-tree ./modules); } diff --git a/modules/flake/pre-commit.nix b/modules/flake/pre-commit.nix new file mode 100644 index 0000000..ee7f813 --- /dev/null +++ b/modules/flake/pre-commit.nix @@ -0,0 +1,25 @@ +{inputs, ...}: { + perSystem = { + pkgs, + system, + ... + }: rec { + checks.pre-commit-check = inputs.git-hooks.lib.${system}.run { + src = ./.; + hooks = { + alejandra = { + enable = true; + }; + }; + }; + + devShells.default = pkgs.mkShell { + inherit (checks.pre-commit-check) shellHook; + buildInputs = with pkgs; + [ + sops + ] + ++ checks.pre-commit-check.enabledPackages; + }; + }; +} diff --git a/modules/flake/systems.nix b/modules/flake/systems.nix new file mode 100644 index 0000000..0b05f44 --- /dev/null +++ b/modules/flake/systems.nix @@ -0,0 +1,6 @@ +{inputs, ...}: { + systems = ["x86_64-linux"]; + perSystem = {system, ...}: { + _module.args.pkgs = inputs.nixpkgs-unstable.legacyPackages.${system}; + }; +} -- 2.44.1