From c4cf85990a7024dc870d35f9dc92e9afa63c3981 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Wed, 10 Mar 2021 18:53:44 +0300 Subject: [PATCH] Add shell.nix and direnv --- .envrc | 1 + .gitignore | 1 + flake.lock | 17 +++++++++++++++++ flake.nix | 13 +++++++++++++ shell.nix | 13 +++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 6329f85..76c9e88 100755 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tramp .\#* result *\.qcow2 +.direnv \ No newline at end of file diff --git a/flake.lock b/flake.lock index 7234fcb..7b2afa7 100644 --- a/flake.lock +++ b/flake.lock @@ -86,6 +86,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1606424373, + "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "haskell-nix": { "locked": { "lastModified": 1587989559, @@ -369,6 +385,7 @@ "NUR": "NUR", "base16-unclaimed-schemes": "base16-unclaimed-schemes", "deploy-rs": "deploy-rs", + "flake-compat": "flake-compat_2", "home-manager": "home-manager", "lambda-launcher": "lambda-launcher", "materia-theme": "materia-theme", diff --git a/flake.nix b/flake.nix index 61ea8a6..e414422 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,10 @@ # nixpkgs-mesa.url = github:nixos/nixpkgs-channels/bdac777becdbb8780c35be4f552c9d4518fe0bdb; lambda-launcher.url = "github:balsoft/lambda-launcher"; deploy-rs.url = "github:serokell/deploy-rs"; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; NUR = { url = "github:nix-community/NUR"; flake = false; @@ -74,6 +78,15 @@ defaultApp = deploy-rs.defaultApp; + devShell.x86_64-linux = with nixpkgs.legacyPackages.x86_64-linux; + mkShell { + buildInputs = [ + nix.defaultPackage.x86_64-linux + deploy-rs.defaultPackage.x86_64-linux + nixfmt + ]; + }; + deploy = { user = "root"; nodes.T420-Laptop = { diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..9eb132a --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +(import + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { + src = ./.; + }).shellNix