remove nom.patch, change filterSource to path
nom.patch gets pulled in to the modules unless filtering is set up, but we're not building custom nixos-rebuild anymore (and haven't for a while) migrates to builtins.path over builtins.filterSource since the semantics seem a bit nicer Removes all the filtering on the directory as we likely don't need it Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
0ddf01baef
commit
6b5dda1f39
13
flake.nix
13
flake.nix
@ -136,17 +136,8 @@
|
|||||||
|
|
||||||
forEachSystem = lib.genAttrs systems;
|
forEachSystem = lib.genAttrs systems;
|
||||||
|
|
||||||
# filter out all non-nix files and returns the nix-store path
|
# gets the base path of the repo
|
||||||
# (ie. git configs, git refs, etc)
|
src = builtins.path { path = ./.; };
|
||||||
#
|
|
||||||
# used for module imports and system search
|
|
||||||
src = builtins.filterSource (
|
|
||||||
path: type:
|
|
||||||
type == "directory"
|
|
||||||
|| lib.hasSuffix ".nix"
|
|
||||||
|| lib.hasSuffix ".yaml"
|
|
||||||
|| lib.hasSuffix ".yml" (baseNameOf path)
|
|
||||||
) ./.;
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
repos = [
|
repos = [
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
From 9d8ce77eaa0d207f0d3e96606dc44abc4e8e0ce0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= <sandro.jaeckel@gmail.com>
|
|
||||||
Date: Sun, 4 Sep 2022 13:04:56 +0200
|
|
||||||
Subject: [PATCH] nixos-rebuild: use nom if available in PATH
|
|
||||||
|
|
||||||
---
|
|
||||||
.../linux/nixos-rebuild/nixos-rebuild.sh | 14 +++++++++-----
|
|
||||||
1 file changed, 9 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
|
|
||||||
index 2051368a49f64c..395a54819e5417 100755
|
|
||||||
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
|
|
||||||
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
|
|
||||||
@@ -14,6 +14,10 @@ showSyntax() {
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
+nom=nix
|
|
||||||
+if type -p nom &>/dev/null; then
|
|
||||||
+ nom=nom
|
|
||||||
+fi
|
|
||||||
|
|
||||||
# Parse the command line.
|
|
||||||
origArgs=("$@")
|
|
||||||
@@ -236,7 +240,7 @@ nixBuild() {
|
|
||||||
logVerbose "Building in legacy (non-flake) mode."
|
|
||||||
if [ -z "$buildHost" ]; then
|
|
||||||
logVerbose "No --build-host given, running nix-build locally"
|
|
||||||
- runCmd nix-build "$@"
|
|
||||||
+ runCmd $nom-build "$@"
|
|
||||||
else
|
|
||||||
logVerbose "buildHost set to \"$buildHost\", running nix-build remotely"
|
|
||||||
local instArgs=()
|
|
||||||
@@ -284,10 +288,10 @@ nixFlakeBuild() {
|
|
||||||
logVerbose "Building in flake mode."
|
|
||||||
if [[ -z "$buildHost" && -z "$targetHost" && "$action" != switch && "$action" != boot && "$action" != test && "$action" != dry-activate ]]
|
|
||||||
then
|
|
||||||
- runCmd nix "${flakeFlags[@]}" build "$@"
|
|
||||||
+ runCmd $nom build "${flakeFlags[@]}" "$@"
|
|
||||||
readlink -f ./result
|
|
||||||
elif [ -z "$buildHost" ]; then
|
|
||||||
- runCmd nix "${flakeFlags[@]}" build "$@" --out-link "${tmpDir}/result"
|
|
||||||
+ runCmd $nom build "${flakeFlags[@]}" "$@" --out-link "${tmpDir}/result"
|
|
||||||
readlink -f "${tmpDir}/result"
|
|
||||||
else
|
|
||||||
local attr="$1"
|
|
||||||
@@ -426,11 +430,11 @@ trap cleanup EXIT
|
|
||||||
# Re-execute nixos-rebuild from the Nixpkgs tree.
|
|
||||||
if [[ -z $_NIXOS_REBUILD_REEXEC && -n $canRun && -z $fast ]]; then
|
|
||||||
if [[ -z $flake ]]; then
|
|
||||||
- if p=$(runCmd nix-build --no-out-link --expr 'with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild' "${extraBuildFlags[@]}"); then
|
|
||||||
+ if p=$(runCmd $nom-build --no-out-link --expr 'with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild' "${extraBuildFlags[@]}"); then
|
|
||||||
SHOULD_REEXEC=1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
- runCmd nix "${flakeFlags[@]}" build --out-link "${tmpDir}/nixos-rebuild" "$flake#$flakeAttr.config.system.build.nixos-rebuild" "${extraBuildFlags[@]}" "${lockFlags[@]}"
|
|
||||||
+ runCmd $nom build "${flakeFlags[@]}" --out-link "${tmpDir}/nixos-rebuild" "$flake#$flakeAttr.config.system.build.nixos-rebuild" "${extraBuildFlags[@]}" "${lockFlags[@]}"
|
|
||||||
if p=$(readlink -e "${tmpDir}/nixos-rebuild"); then
|
|
||||||
SHOULD_REEXEC=1
|
|
||||||
fi
|
|
Loading…
x
Reference in New Issue
Block a user