diff --git a/.envrc b/.envrc index fc802e9..80ffa0d 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,3 @@ # reload when these files change -cd tritonshell watch_file flake.nix use_flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1745212 --- /dev/null +++ b/flake.lock @@ -0,0 +1,95 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1663445644, + "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", + "owner": "numtide", + "repo": "devshell", + "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1665349835, + "narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "tritonshell-module": "tritonshell-module" + } + }, + "tritonshell-module": { + "inputs": { + "devshell": [ + "devshell" + ], + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1665576845, + "narHash": "sha256-MpE+0bMYVog7SRuq0kyEMFbCR4i2htT9KlzD0E/stS4=", + "ref": "main", + "rev": "9f130ca346aab4938009f575b4bd673d67fb5cd4", + "revCount": 43, + "type": "git", + "url": "https://git.greenbaum.cloud/dev/tritonshell" + }, + "original": { + "ref": "main", + "type": "git", + "url": "https://git.greenbaum.cloud/dev/tritonshell" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b289354 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "devs & ops environment for nix'ing with triton"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + flake-utils.url = "github:numtide/flake-utils"; + + devshell.url = "github:numtide/devshell"; + devshell.inputs.flake-utils.follows = "flake-utils"; + devshell.inputs.nixpkgs.follows = "nixpkgs"; + + tritonshell-module.url = "git+https://git.greenbaum.cloud/dev/tritonshell?ref=main"; + tritonshell-module.inputs.devshell.follows = "devshell"; + tritonshell-module.inputs.flake-utils.follows = "flake-utils"; + tritonshell-module.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, flake-utils, devshell, tritonshell-module, nixpkgs }: + flake-utils.lib.simpleFlake { + inherit self nixpkgs; + name = "infra-project"; + preOverlays = [ devshell.overlay ]; + shell = { pkgs }: + pkgs.devshell.mkShell { + imports = [ tritonshell-module.devshellModules.x86_64-linux.tritonshell ]; + # Now the tritonshell environment nix module options are available + environment = { + enable = true; + # CUSTOMIZE if desired, default options are: + #cnsBaseDomain = "greenbaum.zone"; + #dataCenters = [ "cgn-1" "lev-1" ]; + #mantaDomain = "eu-central.manta.greenbaum.cloud"; + #tritonApiDomain = "api.greenbaum.cloud"; + }; + + # Add additional packages you'd like to be available in your devshell + # PATH here + devshell.packages = with pkgs; [ + # used by triton-ansible-inventory + nodejs + ]; + }; + }; +}