From 0afc4f14272190432cceeb5881f32986daa828ea Mon Sep 17 00:00:00 2001 From: Samuel Meenzen Date: Tue, 9 Apr 2024 09:22:45 +0200 Subject: [PATCH] chore: fix nix flake (#3259) --- .gitignore | 2 +- flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 45 ++++++++++++++++++++++++---------------- 3 files changed, 89 insertions(+), 18 deletions(-) create mode 100644 flake.lock diff --git a/.gitignore b/.gitignore index 380d0fa41..42e31f650 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ .DS_Store .python-version .idea/ -flake.lock +.direnv/ # ignore roles pulled by ansible-galaxy /roles/galaxy/* diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..b4d9ebdb9 --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712578459, + "narHash": "sha256-r+rjtYIdwV7mEqFwbvaS7dZSH+3xNW9loR3Rh9C0ifI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b1a486be09c354e25a18689eb21425e43892e38c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 412309a89..3738e97db 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,30 @@ { - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - - outputs = { self, nixpkgs, ... }: - let - pkgs = import nixpkgs { system = "x86_64-linux"; }; - in - { - devShell.x86_64-linux = pkgs.mkShell { - buildInputs = with pkgs; [ - just - python311Packages.ansible-core - python311Packages.passlib - ]; - LC_ALL = "C.UTF-8"; - LC_CTYPE = "C.UTF-8"; - }; - }; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem + ( + system: let + pkgs = import nixpkgs { + inherit system; + }; + in + with pkgs; { + devShells.default = mkShell { + buildInputs = [ + just + ansible + ]; + shellHook = '' + echo "$(ansible --version)" + ''; + }; + } + ); }