HASH 151da369a065
DATE 2024-11-19
SUBJECT templates: initial templates config
FILES 10 CHANGED
HASH 151da369a065
DATE 2024-11-19
SUBJECT templates: initial templates config
FILES 10 CHANGED
┌─ outputs/default.nix ──────────────────────────────────────────────────────┐
│ diff --git a/outputs/default.nix b/outputs/default.nix │
│ index e82fb55..2a45066 100644 │
│ --- a/outputs/default.nix │
│ +++ b/outputs/default.nix │
│ @@ -8,5 +8,6 @@ │
│ ./pkgs │
│ ./images.nix │
│ ./devshells │
│ + ./templates │
│ ]; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ outputs/default.nix ────────────────┐
│ diff --git a/outputs/default.nix b/outputs/d │
│ efault.nix │
│ index e82fb55..2a45066 100644 │
│ --- a/outputs/default.nix │
│ +++ b/outputs/default.nix │
│ @@ -8,5 +8,6 @@ │
│ ./pkgs │
│ ./images.nix │
│ ./devshells │
│ + ./templates │
│ ]; │
│ } │
└──────────────────────────────────────────────┘
┌─ outputs/templates/basic/flake.nix ────────────────────────────────────────┐
│ diff --git a/outputs/templates/basic/flake.nix b/outputs/templates/basic/flake.nix │
│ new file mode 100644 │
│ index 0000000..9db2f0c │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/flake.nix │
│ @@ -0,0 +1,15 @@ │
│ +{ │
│ + description = "Description for the project"; │
│ + │
│ + inputs = { │
│ + flake-parts.url = "github:hercules-ci/flake-parts"; │
│ + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; │
│ + systems.url = "github:nix-systems/default-linux"; │
│ + }; │
│ + │
│ + outputs = inputs @ {flake-parts, ...}: │
│ + flake-parts.lib.mkFlake {inherit inputs;} { │
│ + systems = import inputs.systems; │
│ + imports = [./outputs]; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...uts/templates/basic/flake.nix ───┐
│ diff --git a/outputs/templates/basic/flake.n │
│ ix b/outputs/templates/basic/flake.nix │
│ new file mode 100644 │
│ index 0000000..9db2f0c │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/flake.nix │
│ @@ -0,0 +1,15 @@ │
│ +{ │
│ + description = "Description for the projec │
│ t"; │
│ + │
│ + inputs = { │
│ + flake-parts.url = "github:hercules-ci/f │
│ lake-parts"; │
│ + nixpkgs.url = "github:NixOS/nixpkgs/nix │
│ os-unstable"; │
│ + systems.url = "github:nix-systems/defau │
│ lt-linux"; │
│ + }; │
│ + │
│ + outputs = inputs @ {flake-parts, ...}: │
│ + flake-parts.lib.mkFlake {inherit inputs │
│ ;} { │
│ + systems = import inputs.systems; │
│ + imports = [./outputs]; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/basic/outputs/default.nix ──────────────────────────────┐
│ diff --git a/outputs/templates/basic/outputs/default.nix b/outputs/templates/basic │
│ /outputs/default.nix │
│ new file mode 100644 │
│ index 0000000..ad0ccde │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/outputs/default.nix │
│ @@ -0,0 +1,6 @@ │
│ +{ │
│ + imports = [ │
│ + ./shell.nix │
│ + ./pkgs.nix │
│ + ]; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...tes/basic/outputs/default.nix ───┐
│ diff --git a/outputs/templates/basic/outputs │
│ /default.nix b/outputs/templates/basic/outpu │
│ ts/default.nix │
│ new file mode 100644 │
│ index 0000000..ad0ccde │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/outputs/defaul │
│ t.nix │
│ @@ -0,0 +1,6 @@ │
│ +{ │
│ + imports = [ │
│ + ./shell.nix │
│ + ./pkgs.nix │
│ + ]; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/basic/outputs/pkgs.nix ─────────────────────────────────┐
│ diff --git a/outputs/templates/basic/outputs/pkgs.nix b/outputs/templates/basic/ou │
│ tputs/pkgs.nix │
│ new file mode 100644 │
│ index 0000000..da50d0e │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/outputs/pkgs.nix │
│ @@ -0,0 +1,18 @@ │
│ +{self, ...}: { │
│ + perSystem = { │
│ + pkgs, │
│ + self', │
│ + ... │
│ + }: { │
│ + packages.default = pkgs.stdenvNoCC.mkDerivation { │
│ + pname = "my package"; │
│ + version = "0.1.0"; │
│ + src = "${self}/src"; │
│ + nativeBuildInputs = []; │
│ + │
│ + buildPhase = ""; │
│ + dontInstall = true; │
│ + }; │
│ + apps.default = self'.packages.default; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...plates/basic/outputs/pkgs.nix ───┐
│ diff --git a/outputs/templates/basic/outputs │
│ /pkgs.nix b/outputs/templates/basic/outputs/ │
│ pkgs.nix │
│ new file mode 100644 │
│ index 0000000..da50d0e │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/outputs/pkgs.n │
│ ix │
│ @@ -0,0 +1,18 @@ │
│ +{self, ...}: { │
│ + perSystem = { │
│ + pkgs, │
│ + self', │
│ + ... │
│ + }: { │
│ + packages.default = pkgs.stdenvNoCC.mkDe │
│ rivation { │
│ + pname = "my package"; │
│ + version = "0.1.0"; │
│ + src = "${self}/src"; │
│ + nativeBuildInputs = []; │
│ + │
│ + buildPhase = ""; │
│ + dontInstall = true; │
│ + }; │
│ + apps.default = self'.packages.default; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/basic/outputs/shell.nix ────────────────────────────────┐
│ diff --git a/outputs/templates/basic/outputs/shell.nix b/outputs/templates/basic/o │
│ utputs/shell.nix │
│ new file mode 100644 │
│ index 0000000..97f9514 │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/outputs/shell.nix │
│ @@ -0,0 +1,10 @@ │
│ +{ │
│ + perSystem = {pkgs, ...}: { │
│ + devShells.default = pkgs.mkShellNoCC { │
│ + name = "project devshell"; │
│ + packages = │
│ + builtins.attrValues { │
│ + }; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...lates/basic/outputs/shell.nix ───┐
│ diff --git a/outputs/templates/basic/outputs │
│ /shell.nix b/outputs/templates/basic/outputs │
│ /shell.nix │
│ new file mode 100644 │
│ index 0000000..97f9514 │
│ --- /dev/null │
│ +++ b/outputs/templates/basic/outputs/shell. │
│ nix │
│ @@ -0,0 +1,10 @@ │
│ +{ │
│ + perSystem = {pkgs, ...}: { │
│ + devShells.default = pkgs.mkShellNoCC { │
│ + name = "project devshell"; │
│ + packages = │
│ + builtins.attrValues { │
│ + }; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/default.nix ────────────────────────────────────────────┐
│ diff --git a/outputs/templates/default.nix b/outputs/templates/default.nix │
│ new file mode 100644 │
│ index 0000000..86152ca │
│ --- /dev/null │
│ +++ b/outputs/templates/default.nix │
│ @@ -0,0 +1,12 @@ │
│ +{ │
│ + flake.templates = { │
│ + default = { │
│ + path = ./basic; │
│ + description = "Default project template"; │
│ + }; │
│ + go = { │
│ + path = ./go; │
│ + description = "Basic go template"; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ outputs/templates/default.nix ──────┐
│ diff --git a/outputs/templates/default.nix b │
│ /outputs/templates/default.nix │
│ new file mode 100644 │
│ index 0000000..86152ca │
│ --- /dev/null │
│ +++ b/outputs/templates/default.nix │
│ @@ -0,0 +1,12 @@ │
│ +{ │
│ + flake.templates = { │
│ + default = { │
│ + path = ./basic; │
│ + description = "Default project templa │
│ te"; │
│ + }; │
│ + go = { │
│ + path = ./go; │
│ + description = "Basic go template"; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/go/flake.nix ───────────────────────────────────────────┐
│ diff --git a/outputs/templates/go/flake.nix b/outputs/templates/go/flake.nix │
│ new file mode 100644 │
│ index 0000000..9db2f0c │
│ --- /dev/null │
│ +++ b/outputs/templates/go/flake.nix │
│ @@ -0,0 +1,15 @@ │
│ +{ │
│ + description = "Description for the project"; │
│ + │
│ + inputs = { │
│ + flake-parts.url = "github:hercules-ci/flake-parts"; │
│ + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; │
│ + systems.url = "github:nix-systems/default-linux"; │
│ + }; │
│ + │
│ + outputs = inputs @ {flake-parts, ...}: │
│ + flake-parts.lib.mkFlake {inherit inputs;} { │
│ + systems = import inputs.systems; │
│ + imports = [./outputs]; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ outputs/templates/go/flake.nix ─────┐
│ diff --git a/outputs/templates/go/flake.nix │
│ b/outputs/templates/go/flake.nix │
│ new file mode 100644 │
│ index 0000000..9db2f0c │
│ --- /dev/null │
│ +++ b/outputs/templates/go/flake.nix │
│ @@ -0,0 +1,15 @@ │
│ +{ │
│ + description = "Description for the projec │
│ t"; │
│ + │
│ + inputs = { │
│ + flake-parts.url = "github:hercules-ci/f │
│ lake-parts"; │
│ + nixpkgs.url = "github:NixOS/nixpkgs/nix │
│ os-unstable"; │
│ + systems.url = "github:nix-systems/defau │
│ lt-linux"; │
│ + }; │
│ + │
│ + outputs = inputs @ {flake-parts, ...}: │
│ + flake-parts.lib.mkFlake {inherit inputs │
│ ;} { │
│ + systems = import inputs.systems; │
│ + imports = [./outputs]; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/go/outputs/default.nix ─────────────────────────────────┐
│ diff --git a/outputs/templates/go/outputs/default.nix b/outputs/templates/go/outpu │
│ ts/default.nix │
│ new file mode 100644 │
│ index 0000000..ad0ccde │
│ --- /dev/null │
│ +++ b/outputs/templates/go/outputs/default.nix │
│ @@ -0,0 +1,6 @@ │
│ +{ │
│ + imports = [ │
│ + ./shell.nix │
│ + ./pkgs.nix │
│ + ]; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...plates/go/outputs/default.nix ───┐
│ diff --git a/outputs/templates/go/outputs/de │
│ fault.nix b/outputs/templates/go/outputs/def │
│ ault.nix │
│ new file mode 100644 │
│ index 0000000..ad0ccde │
│ --- /dev/null │
│ +++ b/outputs/templates/go/outputs/default.n │
│ ix │
│ @@ -0,0 +1,6 @@ │
│ +{ │
│ + imports = [ │
│ + ./shell.nix │
│ + ./pkgs.nix │
│ + ]; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/go/outputs/pkgs.nix ────────────────────────────────────┐
│ diff --git a/outputs/templates/go/outputs/pkgs.nix b/outputs/templates/go/outputs/ │
│ pkgs.nix │
│ new file mode 100644 │
│ index 0000000..32ebf2a │
│ --- /dev/null │
│ +++ b/outputs/templates/go/outputs/pkgs.nix │
│ @@ -0,0 +1,20 @@ │
│ +{self, ...}: { │
│ + perSystem = { │
│ + pkgs, │
│ + self', │
│ + lib, │
│ + ... │
│ + }: { │
│ + packages.default = pkgs.buildGoModule { │
│ + pname = "hello"; │
│ + version = "0.0.1"; │
│ + src = "${self}/src"; │
│ + meta.mainProgram = "hello"; │
│ + vendorHash = null; │
│ + }; │
│ + apps.default = { │
│ + type = "app"; │
│ + program = "${lib.getExe self'.packages.default}"; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...templates/go/outputs/pkgs.nix ───┐
│ diff --git a/outputs/templates/go/outputs/pk │
│ gs.nix b/outputs/templates/go/outputs/pkgs.n │
│ ix │
│ new file mode 100644 │
│ index 0000000..32ebf2a │
│ --- /dev/null │
│ +++ b/outputs/templates/go/outputs/pkgs.nix │
│ @@ -0,0 +1,20 @@ │
│ +{self, ...}: { │
│ + perSystem = { │
│ + pkgs, │
│ + self', │
│ + lib, │
│ + ... │
│ + }: { │
│ + packages.default = pkgs.buildGoModule { │
│ + pname = "hello"; │
│ + version = "0.0.1"; │
│ + src = "${self}/src"; │
│ + meta.mainProgram = "hello"; │
│ + vendorHash = null; │
│ + }; │
│ + apps.default = { │
│ + type = "app"; │
│ + program = "${lib.getExe self'.package │
│ s.default}"; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
┌─ outputs/templates/go/outputs/shell.nix ───────────────────────────────────┐
│ diff --git a/outputs/templates/go/outputs/shell.nix b/outputs/templates/go/outputs │
│ /shell.nix │
│ new file mode 100644 │
│ index 0000000..ccf8508 │
│ --- /dev/null │
│ +++ b/outputs/templates/go/outputs/shell.nix │
│ @@ -0,0 +1,10 @@ │
│ +{ │
│ + perSystem = {pkgs, ...}: { │
│ + devShells.default = pkgs.mkShellNoCC { │
│ + name = "project devshell"; │
│ + packages = builtins.attrValues { │
│ + inherit (pkgs) go gopls gotools go-tools; │
│ + }; │
│ + }; │
│ + }; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...emplates/go/outputs/shell.nix ───┐
│ diff --git a/outputs/templates/go/outputs/sh │
│ ell.nix b/outputs/templates/go/outputs/shell │
│ .nix │
│ new file mode 100644 │
│ index 0000000..ccf8508 │
│ --- /dev/null │
│ +++ b/outputs/templates/go/outputs/shell.nix │
│ @@ -0,0 +1,10 @@ │
│ +{ │
│ + perSystem = {pkgs, ...}: { │
│ + devShells.default = pkgs.mkShellNoCC { │
│ + name = "project devshell"; │
│ + packages = builtins.attrValues { │
│ + inherit (pkgs) go gopls gotools go- │
│ tools; │
│ + }; │
│ + }; │
│ + }; │
│ +} │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET