diff --git a/README.md b/README.md new file mode 100644 index 0000000..c3bf1f5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +test README diff --git a/flake.lock b/flake.lock index 0dd329e..f447b8c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,8 +1,40 @@ { "nodes": { + "dedupe_flake-compat": { + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "files": { + "locked": { + "lastModified": 1750263550, + "narHash": "sha256-EW/QJ8i/13GgiynBb6zOMxhLU1uEkRqmzbIDEP23yVA=", + "owner": "mightyiam", + "repo": "files", + "rev": "5f4ef1fd1f9012354a9748be093e277675d10f07", + "type": "github" + }, + "original": { + "owner": "mightyiam", + "repo": "files", + "type": "github" + } + }, "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1751413152, @@ -18,6 +50,41 @@ "type": "github" } }, + "import-tree": { + "locked": { + "lastModified": 1751399845, + "narHash": "sha256-iun7//YHeEFgEOcG4KKKoy3d2GWOYqokLFVU/zIs79Y=", + "owner": "vic", + "repo": "import-tree", + "rev": "e24a50ff9b5871d4bdd8900679784812eeb120ea", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, + "make-shell": { + "inputs": { + "flake-compat": [ + "dedupe_flake-compat" + ] + }, + "locked": { + "lastModified": 1733933815, + "narHash": "sha256-9JjM7eT66W4NJAXpGUsdyAFXhBxFWR2Z9LZwUa7Hli0=", + "owner": "nicknovitski", + "repo": "make-shell", + "rev": "ffeceae9956df03571ea8e96ef77c2924f13a63c", + "type": "github" + }, + "original": { + "owner": "nicknovitski", + "repo": "make-shell", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1751271578, @@ -34,24 +101,13 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1751159883, - "narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, "root": { "inputs": { + "dedupe_flake-compat": "dedupe_flake-compat", + "files": "files", "flake-parts": "flake-parts", + "import-tree": "import-tree", + "make-shell": "make-shell", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 9176110..6f86517 100644 --- a/flake.nix +++ b/flake.nix @@ -3,18 +3,23 @@ # nixos-unstable provides a binary cache for all packages. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # flake-parts lets us define flake modules. - flake-parts.url = "github:hercules-ci/flake-parts"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + # import-tree imports all nix files in a given directory. + import-tree.url = "github:vic/import-tree"; + # files lets us write text files and automatically add checks for them + files.url = "github:mightyiam/files"; + # make-shells. creates devShells and checks + make-shell = { + url = "github:nicknovitski/make-shell"; + inputs.flake-compat.follows = "dedupe_flake-compat"; + }; + + # The following are not used but are here for deduplication. + dedupe_flake-compat.url = "github:edolstra/flake-compat"; }; - outputs = - inputs@{ self, ... }: - inputs.flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ inputs.flake-parts.flakeModules.modules ]; - systems = [ "x86_64-linux" ]; - perSystem = - { pkgs, ... }: - { - packages.default = pkgs.hello; - }; - }; + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); } diff --git a/modules/docs/readme.nix b/modules/docs/readme.nix new file mode 100644 index 0000000..78319e3 --- /dev/null +++ b/modules/docs/readme.nix @@ -0,0 +1,21 @@ +{ config, ... }: +{ + # text.readme = { + # + # }; + + perSystem = + { pkgs, ... }: + { + files.files = [ + { + path_ = "README.md"; + drv = + pkgs.writeText "README.md" # config.text.readme + '' + test README + ''; + } + ]; + }; +} diff --git a/modules/meta/files.nix b/modules/meta/files.nix new file mode 100644 index 0000000..07da696 --- /dev/null +++ b/modules/meta/files.nix @@ -0,0 +1,7 @@ +{ inputs, ... }: +{ + imports = [ inputs.files.flakeModules.default ]; + perSystem = psArgs: { + make-shells.default.packages = [ psArgs.config.files.writer.drv ]; + }; +} diff --git a/modules/meta/make-shell.nix b/modules/meta/make-shell.nix new file mode 100644 index 0000000..9206c92 --- /dev/null +++ b/modules/meta/make-shell.nix @@ -0,0 +1,4 @@ +{ inputs, ... }: +{ + imports = [ inputs.make-shell.flakeModules.default ]; +} diff --git a/modules/systems.nix b/modules/systems.nix new file mode 100644 index 0000000..bed2497 --- /dev/null +++ b/modules/systems.nix @@ -0,0 +1,5 @@ +{ + systems = [ + "x86_64-linux" + ]; +}