From 4476cdcbbc8afbd28351fdcfb68bc7789b09f1f8 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 4 Aug 2024 03:28:17 +0200 Subject: [PATCH 1/3] justfile: init --- justfile | 14 ++++++++++++++ shell.nix | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 00000000..e5b02493 --- /dev/null +++ b/justfile @@ -0,0 +1,14 @@ +export GUM_FILTER_HEIGHT := "15" +nom := `if command -v nom >/dev/null; then echo nom; else echo nix; fi` + +@_default: + just "$(gum choose --ordered --header "Pick a recipie..." $(just --summary --unsorted))" + +check: + nix flake check --keep-going + +build-machine machine=`just _a_machine`: + {{nom}} build .#nixosConfigurations.{{ machine }}.config.system.build.toplevel + +_a_machine: + nix eval .#nixosConfigurations --apply builtins.attrNames --json | jq .[] -r | gum filter diff --git a/shell.nix b/shell.nix index ee91ca44..7e7f44f1 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,9 @@ { pkgs ? import {} }: pkgs.mkShellNoCC { packages = with pkgs; [ + justfile + jq + gum sops gnupg openstackclient From 0bfa6ac329104cbf961d7da1986c1bf05a854b3e Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 4 Aug 2024 17:19:33 +0200 Subject: [PATCH 2/3] flake.nix: export inputs --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index 6a50f8b4..a9dafc4e 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,8 @@ "ildkule" ]; in { + inherit inputs; + nixosConfigurations = let unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux; nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate From 34637e383af5a1c5a56002ab11b3b83993507da5 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 4 Aug 2024 17:19:40 +0200 Subject: [PATCH 3/3] justfile: add update-inputs recipe --- justfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/justfile b/justfile index e5b02493..41dca725 100644 --- a/justfile +++ b/justfile @@ -10,5 +10,12 @@ check: build-machine machine=`just _a_machine`: {{nom}} build .#nixosConfigurations.{{ machine }}.config.system.build.toplevel +@update-inputs: + nix eval .#inputs --apply builtins.attrNames --json \ + | jq '.[]' -r \ + | gum choose --no-limit --height=15 \ + | xargs nix flake update --commit-lock-file + + _a_machine: nix eval .#nixosConfigurations --apply builtins.attrNames --json | jq .[] -r | gum filter