From a0ec64e6b2611b4431e7854dddc1c90195beeb28 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Wed, 24 Apr 2024 20:39:26 -0500 Subject: [PATCH] feat: nix Signed-off-by: jolheiser --- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++++ go.mod.sri | 1 + 3 files changed, 62 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 go.mod.sri diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8f5e0f2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1713805509, + "narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1e1dc66fe68972a76679644a5577828b6a7e8be4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c867ded --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + description = "nixfig, nix configuration"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + outputs = { + self, + nixpkgs, + }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + nixgen = pkgs.buildGoModule { + pname = "nixgen"; + version = self.rev or "dev"; + src = ./.; + vendorHash = pkgs.lib.fileContents ./go.mod.sri; + doCheck = false; + meta = with pkgs.lib; { + description = "nixfig, nix configuration"; + homepage = "https:/git.jolheiser.com/nixfig"; + maintainers = with maintainers; [jolheiser]; + mainProgram = "nixgen"; + }; + }; + in { + packages.${system}.default = nixgen; + devShells.${system}.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + go + gopls + ]; + }; + }; +} diff --git a/go.mod.sri b/go.mod.sri new file mode 100644 index 0000000..202b1f4 --- /dev/null +++ b/go.mod.sri @@ -0,0 +1 @@ +sha256-zCqjwA9uFvE9qg0WHAGZxWIHxBLpPbaSg7Nn+YE6pHc= \ No newline at end of file