From 4c4c0631cb6addc8b9493d6b21aa4cdb01cb808a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Nov 2024 11:13:00 -0500 Subject: [PATCH 1/3] `om ci`: Add --accept-flake-config option --- crates/nix_rs/src/command.rs | 8 ++++++++ doc/src/history.md | 1 + 2 files changed, 9 insertions(+) diff --git a/crates/nix_rs/src/command.rs b/crates/nix_rs/src/command.rs index 04a14f6e..da543d5d 100644 --- a/crates/nix_rs/src/command.rs +++ b/crates/nix_rs/src/command.rs @@ -43,6 +43,10 @@ pub struct NixCmd { /// Consider all previously downloaded files out-of-date. #[cfg_attr(feature = "clap", arg(long))] pub refresh: bool, + + /// Accept `nixConfig` configuration in flake.nix + #[cfg_attr(feature = "clap", arg(long))] + pub accept_flake_config: bool, } impl Default for NixCmd { @@ -54,6 +58,7 @@ impl Default for NixCmd { extra_experimental_features: vec![], extra_access_tokens: vec![], refresh: false, + accept_flake_config: true, } } } @@ -205,6 +210,9 @@ impl NixCmd { if self.refresh { args.push("--refresh".to_string()); } + if self.accept_flake_config { + args.push("--accept-flake-config".to_string()); + } args } } diff --git a/doc/src/history.md b/doc/src/history.md index ce63fbe5..2d67d53f 100644 --- a/doc/src/history.md +++ b/doc/src/history.md @@ -17,6 +17,7 @@ - Support for CI steps - Run `nix flake check` on all subflakes (#200) - Ability to add a custom CI step. For example, to run arbitrary commands. + - Add `--accept-flake-config` - Add `--results=FILE` to store CI results as JSON in a file - Misc - Avoid running `nix-store` command multiple times (#224) From aa326938eead5ab47e5e6accc363d8a9f4679603 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Nov 2024 11:19:19 -0500 Subject: [PATCH 2/3] nix: Remove pkgs.nix from devShell --- crates/nix_rs/crate.nix | 2 +- crates/omnix-gui/crate.nix | 2 +- crates/omnix-health/crate.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/nix_rs/crate.nix b/crates/nix_rs/crate.nix index 298d8ebb..bb710a0d 100644 --- a/crates/nix_rs/crate.nix +++ b/crates/nix_rs/crate.nix @@ -13,7 +13,7 @@ in crane = { args = { nativeBuildInputs = with pkgs; [ - nix # Tests need nix cli + # nix # Tests need nix cli ]; DEFAULT_FLAKE_SCHEMAS = lib.cleanSourceWith { name = "flake-schemas"; diff --git a/crates/omnix-gui/crate.nix b/crates/omnix-gui/crate.nix index 2e29de0f..8062f2fb 100644 --- a/crates/omnix-gui/crate.nix +++ b/crates/omnix-gui/crate.nix @@ -32,7 +32,7 @@ in makeWrapper tailwindcss dioxus-cli - pkgs.nix # cargo tests need nix + # pkgs.nix # cargo tests need nix ]; inherit (rust-project.crates."omnix-cli".crane.args) DEFAULT_FLAKE_SCHEMAS; diff --git a/crates/omnix-health/crate.nix b/crates/omnix-health/crate.nix index 4c1b6d88..8e7f9feb 100644 --- a/crates/omnix-health/crate.nix +++ b/crates/omnix-health/crate.nix @@ -25,7 +25,7 @@ in ; CACHIX_BIN = pkgs.cachix + /bin/cachix; nativeBuildInputs = with pkgs; [ - nix # Tests need nix cli + # nix # Tests need nix cli ]; } // lib.optionalAttrs pkgs.stdenv.isLinux { CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl"; From 0ed2a389d6b4c8eb78caed778e20e872d2a59973 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Nov 2024 11:19:50 -0500 Subject: [PATCH 3/3] `om init`: Update registry flake.lock --- crates/omnix-init/registry/flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/omnix-init/registry/flake.lock b/crates/omnix-init/registry/flake.lock index dcae84c6..09e64d89 100644 --- a/crates/omnix-init/registry/flake.lock +++ b/crates/omnix-init/registry/flake.lock @@ -3,11 +3,11 @@ "haskell-flake": { "flake": false, "locked": { - "lastModified": 1728227251, - "narHash": "sha256-JLDhMFyGyFe0QJAbCuSxB7/kjUCA7uUAMa6BFRORwXk=", + "lastModified": 1731272671, + "narHash": "sha256-QS+dOZzsqLJ8NjhLCHp3zKD+d9nUThL/pcA4U0TlYBs=", "owner": "srid", "repo": "haskell-flake", - "rev": "9cbfbfc38f1fbf9a0f471795c84780211875fd45", + "rev": "f42037d5e1a4ab012fc6783e2857e8dad511518c", "type": "github" }, "original": { @@ -19,11 +19,11 @@ "haskell-template": { "flake": false, "locked": { - "lastModified": 1728428876, - "narHash": "sha256-DJFBFzs9+45z/i53kqYge6L3kxzRok+d2JQcYjBWT50=", + "lastModified": 1730305293, + "narHash": "sha256-S4aW54VSjh3nHn+1kKjxk+hoqODfPQkJc3QzvY/yvvk=", "owner": "srid", "repo": "haskell-template", - "rev": "c05c9977e04c0e09ae6b5e06ac2f2332c60dcad5", + "rev": "5ee2fbcf7984a8cd685984eeb58cb96b47f90f1b", "type": "github" }, "original": { @@ -35,11 +35,11 @@ "nixos-unified-template": { "flake": false, "locked": { - "lastModified": 1728495100, - "narHash": "sha256-SHTeInt30t+pEPIpP4OSyf1iuofI4+BhOBTsKk2jQRw=", + "lastModified": 1731335978, + "narHash": "sha256-yxGFTgYfKdnub7ElY1AtdmWSFFQa9GtgA48su1lD764=", "owner": "juspay", "repo": "nixos-unified-template", - "rev": "f8ce617b401c3ca5d694931486599bcb28671037", + "rev": "ceda317722dcb78239826fbeab7cfe818889a12c", "type": "github" }, "original": { @@ -59,11 +59,11 @@ "rust-nix-template": { "flake": false, "locked": { - "lastModified": 1728428985, - "narHash": "sha256-QSJyUpGjBsBnhvKPlpu5ZQZu8wlUtdk2sw8Wn/cyR/0=", + "lastModified": 1729171644, + "narHash": "sha256-17ROVavzUTde/3b2tCc0HopqYIxrhEnj0DlgmGLitYM=", "owner": "srid", "repo": "rust-nix-template", - "rev": "f1fea514816b0c9ed39fb19985726377ddcf32fd", + "rev": "78dac57bcbb9199ed258108af6e0e727b9ad4436", "type": "github" }, "original": {