Format all files
This commit is contained in:
parent
f2abbe8561
commit
59708b8f04
110 changed files with 1439 additions and 1484 deletions
|
@ -5,10 +5,10 @@ fi
|
|||
|
||||
~/.automated_script.sh
|
||||
|
||||
if bash -c "ls /sys/class/backlight/*/max_brightness" > /dev/null 2>&1;
|
||||
if bash -c "ls /sys/class/backlight/*/max_brightness" > /dev/null 2>&1
|
||||
then
|
||||
cat /sys/class/backlight/*/max_brightness > /sys/class/backlight/*/brightness
|
||||
fi;
|
||||
fi
|
||||
|
||||
cd "PortValhalla"
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ begin
|
|||
git -C "$projectDir" ls-files --exclude-standard --others
|
||||
end | \
|
||||
rsync --files-from=/dev/stdin --exclude={.gitignore,README.md,scripts,LICENSE,valhalla.patch} "$dir/.." "$contextRoot"
|
||||
end &> /dev/null;
|
||||
end &> /dev/null
|
||||
|
||||
and git -C "$contextRoot" diff
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/airootfs/root/.zlogin b/airootfs/root/.zlogin
|
||||
index bf6bc8f..6c333e3 100644
|
||||
index bf6bc8f..0c263a9 100644
|
||||
--- a/airootfs/root/.zlogin
|
||||
+++ b/airootfs/root/.zlogin
|
||||
@@ -4,3 +4,18 @@ if grep -Fqa 'accessibility=' /proc/cmdline &> /dev/null; then
|
||||
|
@ -7,10 +7,10 @@ index bf6bc8f..6c333e3 100644
|
|||
|
||||
~/.automated_script.sh
|
||||
+
|
||||
+if bash -c "ls /sys/class/backlight/*/max_brightness" > /dev/null 2>&1;
|
||||
+if bash -c "ls /sys/class/backlight/*/max_brightness" > /dev/null 2>&1
|
||||
+then
|
||||
+ cat /sys/class/backlight/*/max_brightness > /sys/class/backlight/*/brightness
|
||||
+fi;
|
||||
+fi
|
||||
+
|
||||
+cd "PortValhalla"
|
||||
+
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
let
|
||||
inherit (nixpkgs) lib;
|
||||
nixpkgs = import <nixpkgs> { config = {}; overlay = []; };
|
||||
nixpkgs = import <nixpkgs> {
|
||||
config = { };
|
||||
overlay = [ ];
|
||||
};
|
||||
property = (builtins.getEnv "PROPERTY");
|
||||
processor = if (builtins.stringLength property > 0)
|
||||
then
|
||||
processor = if (builtins.stringLength property > 0) then
|
||||
(_: lib.attrsets.getAttrFromPath (lib.strings.splitString "." property) _)
|
||||
else
|
||||
(_: _);
|
||||
in
|
||||
_: processor (lib.evalModules {
|
||||
modules = [
|
||||
_
|
||||
];
|
||||
}).config
|
||||
in _: processor (lib.evalModules { modules = [ _ ]; }).config
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
options = {
|
||||
valhalla = mkOption {
|
||||
type = types.submodule (
|
||||
{ extendModules, ... }:
|
||||
let
|
||||
{ extendModules, ... }: let
|
||||
osVariant = extendModules {
|
||||
modules = [
|
||||
({ config, ... }: {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
gitType = types.submodule (
|
||||
{ ... }: {
|
||||
gitType = types.submodule ({ ... }: {
|
||||
options = {
|
||||
defaultBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
|
||||
syncType = types.submodule (
|
||||
{ ... }: {
|
||||
syncType = types.submodule ({ ... }: {
|
||||
options = {
|
||||
remotePath = mkOption {
|
||||
type = types.str;
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
themeType = types.submodule (
|
||||
{ config, ... }: {
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
syncType = types.submodule (
|
||||
{ ... }: {
|
||||
|
|
|
@ -16,13 +16,13 @@ function chooseDisk -a outFile message selectScript
|
|||
cat | while read disk
|
||||
set -l diskInfo (string split -n " " $disk)
|
||||
|
||||
if contains "$diskInfo[3]" "disk"
|
||||
if contains "$diskInfo[3]" disk
|
||||
set -a disks "$disk"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
select "$header" "$outFile" "$message" "No valid disk found!" "$(string collect $disks)" "false"
|
||||
select "$header" "$outFile" "$message" "No valid disk found!" "$(string collect $disks)" false
|
||||
and begin
|
||||
set -l disk (string split -n " " (cat "$outFile"))
|
||||
echo "/dev/$disk[1]" >$outFile
|
||||
|
|
|
@ -5,18 +5,19 @@ function confirm -a message default
|
|||
while true
|
||||
read -l value -P "$message $options "
|
||||
or exit 1
|
||||
|
||||
set value (string lower "$value")
|
||||
|
||||
if [ -z "$value" ]
|
||||
set value $default
|
||||
end
|
||||
|
||||
if contains "$value" "0" "false" "n" "no"
|
||||
if contains "$value" 0 false n no
|
||||
false
|
||||
return
|
||||
end
|
||||
|
||||
if contains "$value" "1" "true" "y" "yes"
|
||||
if contains "$value" 1 true y yes
|
||||
true
|
||||
return
|
||||
end
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkOption
|
||||
;
|
||||
inherit (lib) types mkOption;
|
||||
|
||||
fs = import ./fs.nix;
|
||||
|
||||
|
@ -37,15 +34,15 @@
|
|||
};
|
||||
|
||||
devicePath = mkOption {
|
||||
type =
|
||||
if osDisk
|
||||
then types.nullOr types.str
|
||||
else types.str;
|
||||
type = if osDisk then
|
||||
types.nullOr types.str
|
||||
else
|
||||
types.str;
|
||||
description = "The path to the device.";
|
||||
default =
|
||||
if osDisk && config.deviceName == null
|
||||
then null
|
||||
else "/dev/${config.deviceName}";
|
||||
default = if osDisk && config.deviceName == null then
|
||||
null
|
||||
else
|
||||
"/dev/${config.deviceName}";
|
||||
};
|
||||
|
||||
deviceScript = mkOption {
|
||||
|
@ -72,10 +69,9 @@
|
|||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
config = let
|
||||
diskVarName = "${diskListVarName}[${config.id}]";
|
||||
diskVar = ''''${${diskVarName}}'';
|
||||
diskVar = "\${${diskVarName}}";
|
||||
|
||||
diskSelector = ''
|
||||
result="$(mktemp)"
|
||||
|
@ -83,15 +79,16 @@
|
|||
${diskVarName}="$(cat "$result")"
|
||||
'';
|
||||
|
||||
partitions = lib.lists.sortOn
|
||||
(_: _.index)
|
||||
(builtins.filter (_: _ != null) (builtins.attrValues config.partitions));
|
||||
partitions = lib.lists.sortOn (_: _.index)
|
||||
(builtins.filter (_: _ != null)
|
||||
(builtins.attrValues config.partitions));
|
||||
|
||||
mkType = type:
|
||||
lib.strings.escapeShellArg (
|
||||
if builtins.isInt type
|
||||
then "${lib.trivial.toHexString type}"
|
||||
else type);
|
||||
if builtins.isInt type then
|
||||
"${lib.trivial.toHexString type}"
|
||||
else
|
||||
type);
|
||||
|
||||
fdiskCommand = arguments: "sudo sfdisk ${arguments}";
|
||||
fdiskScript = script: append: "echo ${script} | ${fdiskCommand "${if append then "--append" else ""} ${diskVar}"}";
|
||||
|
@ -102,25 +99,17 @@
|
|||
(partition: "${fdiskCommand "--delete ${diskVar} ${toString partition.index}"} || true")
|
||||
(builtins.filter (_: !_.keepExisting) partitions));
|
||||
|
||||
fdiskCommands = lib.strings.concatLines (
|
||||
lib.optionals config.wipe [
|
||||
fdiskCommands = lib.strings.concatLines
|
||||
(lib.optionals config.wipe [
|
||||
cleanup
|
||||
(wipeScript "label: gpt")
|
||||
] ++
|
||||
(builtins.concatMap (
|
||||
] ++ (builtins.concatMap (
|
||||
partition:
|
||||
let
|
||||
inherit (partition)
|
||||
format
|
||||
index
|
||||
keepExisting
|
||||
label
|
||||
sizeScript
|
||||
type
|
||||
;
|
||||
inherit (partition) format index keepExisting label sizeScript type;
|
||||
|
||||
partVarName = "myPartition";
|
||||
partVar = ''''${${partVarName}}'';
|
||||
partVar = "\${${partVarName}}";
|
||||
|
||||
sizeOption = ''
|
||||
${sizeScript} | sed -e "s/.*[^[:space:]]/size=\0/"
|
||||
|
@ -141,7 +130,7 @@
|
|||
};
|
||||
|
||||
create = lib.strings.concatLines [
|
||||
(appendScript "${toString index}: \"$(${sizeOption})\" type=${mkType type}")
|
||||
(appendScript ''${toString index}: "$(${sizeOption})" type=${mkType type}'')
|
||||
probeScript
|
||||
"sudo ${formatScripts.${format}}"
|
||||
];
|
||||
|
@ -157,13 +146,11 @@
|
|||
''local ${partVarName}="$diskPath-part${toString index}"''
|
||||
(if keepExisting then fallback else create)
|
||||
"sudo ${labelScripts.${format} label}"
|
||||
])
|
||||
partitions)
|
||||
);
|
||||
]) partitions));
|
||||
|
||||
fixType = lib.strings.concatLines (
|
||||
builtins.concatMap
|
||||
(partition: lib.optional
|
||||
fixType = lib.strings.concatLines (builtins.concatMap (
|
||||
partition:
|
||||
lib.optional
|
||||
(partition.keepExisting && !(builtins.isNull partition.type))
|
||||
''sudo sfdisk --part-type ${diskVar} ${toString partition.index} ${mkType partition.type}'')
|
||||
partitions);
|
||||
|
@ -173,8 +160,7 @@
|
|||
|
||||
deviceScript = if osDisk && config.devicePath == null then ''
|
||||
${diskSelector}
|
||||
''
|
||||
else ''
|
||||
'' else ''
|
||||
${diskVarName}=${config.devicePath}
|
||||
${if osDisk then ''
|
||||
if [ ! -b ${diskVar} ]; then
|
||||
|
@ -186,9 +172,11 @@
|
|||
exit 1
|
||||
fi
|
||||
}
|
||||
fallback;
|
||||
|
||||
fallback
|
||||
fi
|
||||
'' else ""}
|
||||
'' else
|
||||
""}
|
||||
'';
|
||||
|
||||
script = lib.mkDefault ''
|
||||
|
@ -203,6 +191,7 @@
|
|||
'';
|
||||
};
|
||||
});
|
||||
|
||||
partitionType = types.submodule (
|
||||
{ name, config, ... }: {
|
||||
options = {
|
||||
|
@ -232,10 +221,10 @@
|
|||
format = mkOption {
|
||||
type = types.enum (builtins.attrValues fs);
|
||||
description = "The file system format of the partition.";
|
||||
default =
|
||||
if (isSwap config)
|
||||
then fs.swap
|
||||
else throw("Partition format not specified.");
|
||||
default = if (isSwap config) then
|
||||
fs.swap
|
||||
else
|
||||
throw ("Partition format not specified.");
|
||||
};
|
||||
|
||||
size = mkOption {
|
||||
|
@ -270,16 +259,12 @@
|
|||
};
|
||||
|
||||
config = {
|
||||
sizeScript = (
|
||||
if isSwap config
|
||||
then
|
||||
sizeScript = (if isSwap config then
|
||||
''echo "$(cat /proc/meminfo | awk -F " " '/^MemTotal/ { print $2 }' | awk '{ print int((($1 / 1024 / 1024) * 0.75) + 0.5)}')"G''
|
||||
else
|
||||
"echo ${lib.strings.escapeShellArg (toString config.size)}"
|
||||
);
|
||||
"echo ${lib.strings.escapeShellArg (toString config.size)}");
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
|
@ -312,19 +297,16 @@
|
|||
config = {
|
||||
valhalla = {
|
||||
partition = {
|
||||
script = lib.mkDefault (
|
||||
let
|
||||
script = lib.mkDefault (let
|
||||
cfg = config.valhalla.partition;
|
||||
inherit (cfg) os rootDir;
|
||||
inherit (lib.strings) normalizePath;
|
||||
|
||||
partPath = part: "/dev/disk/by-label/${part.label}";
|
||||
disks = ([ os ] ++ (builtins.attrValues cfg.disks));
|
||||
partitions = (builtins.concatMap (_: (builtins.attrValues _.partitions)) disks);
|
||||
|
||||
mountScript = lib.strings.concatLines (
|
||||
builtins.concatMap
|
||||
(_: [
|
||||
mountScript = lib.strings.concatLines (builtins.concatMap (
|
||||
_: [
|
||||
probeScript
|
||||
(builtins.concatStringsSep " " ([
|
||||
"sudo"
|
||||
|
@ -337,39 +319,34 @@
|
|||
(partPath _)
|
||||
(normalizePath "/${rootDir}/${_.mountPoint}")
|
||||
]))
|
||||
])
|
||||
(lib.lists.sortOn
|
||||
]) (lib.lists.sortOn
|
||||
(_: normalizePath "/${_.mountPoint}")
|
||||
(builtins.filter (_: _.mountPoint != null) partitions)));
|
||||
|
||||
swapScript = lib.strings.concatLines (
|
||||
builtins.map
|
||||
(_: ''
|
||||
swapScript = lib.strings.concatLines (builtins.map (
|
||||
_: ''
|
||||
${probeScript}
|
||||
sudo swapon ${partPath _}
|
||||
'')
|
||||
(builtins.filter (_: _.useSwap) partitions));
|
||||
'') (builtins.filter (_: _.useSwap) partitions));
|
||||
in lib.strings.concatLines ([
|
||||
"#!/bin/bash"
|
||||
"set -o errexit"
|
||||
] ++
|
||||
(builtins.map (_: _.deviceScript) disks) ++
|
||||
lib.optionals ((builtins.length disks) > 0) [
|
||||
]
|
||||
++ (builtins.map (_: _.deviceScript) disks)
|
||||
++ lib.optionals ((builtins.length disks) > 0) [
|
||||
''echo "$(tput setaf 3)==== WARNING ====$(tput sgr0)"''
|
||||
(''echo "Continuing this script will alter the partitions of '' + (
|
||||
lib.strings.concatStringsSep ", " (builtins.map (_: "${_.deviceVariable}") (lib.lists.init disks))
|
||||
) + (if (builtins.length disks) > 1 then " and " else "") + (lib.lists.last disks).deviceVariable + ''"'')
|
||||
(''echo "Continuing this script will alter the partitions of ''
|
||||
+ (lib.strings.concatStringsSep ", " (builtins.map (_: "${_.deviceVariable}") (lib.lists.init disks)))
|
||||
+ (if (builtins.length disks) > 1 then " and " else "") + (lib.lists.last disks).deviceVariable + ''"'')
|
||||
''
|
||||
if ! fish ${./confirm.fish} "Are you sure you want to continue?" "n"; then
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
] ++
|
||||
(builtins.map (_: _.script) disks) ++ [
|
||||
] ++ (builtins.map (_: _.script) disks) ++ [
|
||||
mountScript
|
||||
swapScript
|
||||
]
|
||||
));
|
||||
]));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
function select -a header outFile message error choices loop
|
||||
if [ -z "$loop" ]
|
||||
set loop "true"
|
||||
set loop true
|
||||
end
|
||||
|
||||
while true
|
||||
|
|
|
@ -1,23 +1,12 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
inherit (lib) mkOption types;
|
||||
cfg = config.valhalla;
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
software =
|
||||
let
|
||||
inherit (cfg.software)
|
||||
coding
|
||||
common
|
||||
desktopExperience
|
||||
school
|
||||
server
|
||||
;
|
||||
software = let
|
||||
inherit (cfg.software) coding common desktopExperience school server;
|
||||
in {
|
||||
essential = mkOption {
|
||||
type = types.bool;
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
capitalize = (import ../text.nix { inherit lib; }).capitalize;
|
||||
|
||||
|
@ -60,25 +57,20 @@
|
|||
default = { };
|
||||
};
|
||||
|
||||
linux.users = mkOption {
|
||||
type = types.attrsOf linuxUserType;
|
||||
};
|
||||
linux.users = mkOption { type = types.attrsOf linuxUserType; };
|
||||
|
||||
windows = mkOption {
|
||||
type = types.submoduleWith {
|
||||
modules = [
|
||||
({ config, options, ... }: {
|
||||
options = {
|
||||
users = mkOption {
|
||||
type = types.attrsOf winUserType;
|
||||
};
|
||||
users = mkOption { type = types.attrsOf winUserType; };
|
||||
|
||||
winUsers = mkOption {
|
||||
type = options.users.type;
|
||||
default = (lib.attrsets.concatMapAttrs (
|
||||
name: options: {
|
||||
${capitalize name} = options;
|
||||
}) config.users);
|
||||
default = (lib.attrsets.concatMapAttrs
|
||||
(name: options: { ${capitalize name} = options; })
|
||||
config.users);
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
let inherit (lib) mkOption types;
|
||||
in {
|
||||
imports = [
|
||||
./hardware.nix
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkDefault
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
inherit (lib) mkDefault mkEnableOption mkIf mkOption types;
|
||||
capitalize = (import ../text.nix { inherit lib; }).capitalize;
|
||||
in {
|
||||
options = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ pkgs, fetchFromGitLab, ... }: pkgs.stdenv.mkDerivation (
|
||||
rec {
|
||||
{ pkgs, fetchFromGitLab, ... }:
|
||||
pkgs.stdenv.mkDerivation (rec {
|
||||
pname = "archiso";
|
||||
version = "79";
|
||||
|
||||
|
|
10
lib/text.nix
10
lib/text.nix
|
@ -1,9 +1,7 @@
|
|||
{ lib, ... }: {
|
||||
capitalize = text:
|
||||
let
|
||||
chars = lib.strings.stringToCharacters text;
|
||||
in lib.strings.concatStrings (
|
||||
[(lib.strings.toUpper (builtins.elemAt chars 0))] ++
|
||||
(lib.lists.drop 1 chars)
|
||||
);
|
||||
let chars = lib.strings.stringToCharacters text;
|
||||
in lib.strings.concatStrings
|
||||
([ (lib.strings.toUpper (builtins.elemAt chars 0)) ]
|
||||
++ (lib.lists.drop 1 chars));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{ lib, ... }: {
|
||||
imports = [
|
||||
../defaults.nix
|
||||
];
|
||||
imports = [ ../defaults.nix ];
|
||||
|
||||
config = {
|
||||
valhalla = {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
../config.nix
|
||||
];
|
||||
imports = [ ../config.nix ];
|
||||
|
||||
config = {
|
||||
valhalla.boot.label = "Arch";
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
fs = import ../../../../lib/modules/partition/fs.nix;
|
||||
let fs = import ../../../../lib/modules/partition/fs.nix;
|
||||
in {
|
||||
imports = [
|
||||
../defaults.nix
|
||||
];
|
||||
imports = [ ../defaults.nix ];
|
||||
|
||||
config = {
|
||||
valhalla = {
|
||||
|
@ -40,8 +37,7 @@
|
|||
keyboardLayout = "ch";
|
||||
|
||||
i18n = {
|
||||
localeSettings =
|
||||
let defaultLocale = "en_US.UTF-8";
|
||||
localeSettings = let defaultLocale = "en_US.UTF-8";
|
||||
in {
|
||||
LANG = "de_CH.UTF-8";
|
||||
LANGUAGE = defaultLocale;
|
||||
|
@ -49,9 +45,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
git =
|
||||
let
|
||||
defaultBranch = "main";
|
||||
git = let defaultBranch = "main";
|
||||
in {
|
||||
inherit defaultBranch;
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
../config.nix
|
||||
];
|
||||
imports = [ ../config.nix ];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
../Generic/Arch/config.nix
|
||||
];
|
||||
imports = [ ../Generic/Arch/config.nix ];
|
||||
|
||||
config = {
|
||||
valhalla = {
|
||||
|
@ -13,9 +11,7 @@
|
|||
surfaceBook = true;
|
||||
xoneReceiver = true;
|
||||
|
||||
components = [
|
||||
"Logitech G903"
|
||||
];
|
||||
components = [ "Logitech G903" ];
|
||||
};
|
||||
|
||||
partition.os.deviceName = "nvme0n1";
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
../../../lib/modules/valhalla.nix
|
||||
];
|
||||
imports = [ ../../../lib/modules/valhalla.nix ];
|
||||
|
||||
config = {
|
||||
valhalla = {
|
||||
|
@ -40,8 +38,7 @@
|
|||
|
||||
windows.users.manuel = {
|
||||
nextcloud = {
|
||||
folderSyncs =
|
||||
let
|
||||
folderSyncs = let
|
||||
localPath = "C:/tools/RetroArch-Win64";
|
||||
remotePath = "/Saved Games/RetroArch";
|
||||
in [
|
||||
|
|
|
@ -4,7 +4,7 @@ begin
|
|||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW -V dir
|
||||
set -l repo "linux-surface"
|
||||
set -l repo linux-surface
|
||||
set -l file "/etc/pacman.conf"
|
||||
|
||||
curl -s https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
|
||||
|
|
|
@ -3,7 +3,7 @@ begin
|
|||
set -l dir (status dirname)
|
||||
|
||||
function getDeploymentScript -V dir
|
||||
echo "$dir/../Scripts/deploy.fish";
|
||||
echo "$dir/../Scripts/deploy.fish"
|
||||
end
|
||||
|
||||
function initialize -V dir
|
||||
|
|
|
@ -14,7 +14,7 @@ begin
|
|||
|
||||
function installDrivers -S
|
||||
if isOSEnabled hardware.surfaceBook
|
||||
pacstrap -K "$mountDir" linux-firmware-marvell;
|
||||
pacstrap -K "$mountDir" linux-firmware-marvell
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ function deploySoftware -d "Deploys a the specified software action" -a action
|
|||
. "$dir/software.fish"
|
||||
|
||||
if [ -z "$action" ]
|
||||
set action "install"
|
||||
set action install
|
||||
end
|
||||
|
||||
set -l isInstall (
|
||||
|
|
|
@ -18,7 +18,7 @@ begin
|
|||
' if [ "${HOOKS[i]}" = "kms" ]; then' \
|
||||
' unset "HOOKS[i]"' \
|
||||
" fi" \
|
||||
"done"
|
||||
done
|
||||
end | sudo tee /etc/mkinitcpio.conf.d/nvidia.conf >/dev/null
|
||||
|
||||
fish "$dir/../../../Common/Software/nvidia-dkms/main.fish" configure
|
||||
|
|
|
@ -11,7 +11,7 @@ begin
|
|||
set homeDir ~"$user"
|
||||
set flags -u "$user"
|
||||
else
|
||||
set homeDir "/etc/skel"
|
||||
set homeDir /etc/skel
|
||||
end
|
||||
|
||||
for bin in $bins
|
||||
|
@ -19,7 +19,7 @@ begin
|
|||
begin
|
||||
set -l file "$homeDir/.config/$bin-flags.conf"
|
||||
sudo $flags mkdir -p (dirname "$file")
|
||||
echo "--touch-events" | sudo $flags tee "$file" > /dev/null
|
||||
echo --touch-events | sudo $flags tee "$file" >/dev/null
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,9 +8,8 @@ if [ (id -u) -eq 0 ]
|
|||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||
rm ~/.bash_profile
|
||||
|
||||
runHook createUser || \
|
||||
begin
|
||||
echo "Creating setup user";
|
||||
runHook createUser || begin
|
||||
echo "Creating setup user"
|
||||
|
||||
and useradd \
|
||||
--comment "PortValhalla Setup User" \
|
||||
|
|
|
@ -36,7 +36,7 @@ function runSetup
|
|||
end
|
||||
|
||||
function runInOS -S
|
||||
set -l script "/root/run_once"
|
||||
set -l script /root/run_once
|
||||
wrapScript $argv | chroot "$mountDir" tee "$script" >/dev/null
|
||||
and runChroot "$mountDir" chmod +x "$script"
|
||||
and runChroot "$mountDir" "$script"
|
||||
|
|
|
@ -12,7 +12,7 @@ for name in (echo "$users" | jq '.[]' --raw-output0 | string split0)
|
|||
getUserConfig "$name" "$config" $argv[2..]
|
||||
end
|
||||
|
||||
set -l groups (getUserInfo groups --apply 'builtins.concatStringsSep ","');
|
||||
set -l groups (getUserInfo groups --apply 'builtins.concatStringsSep ","')
|
||||
set -l displayName (getUserInfo displayName --json)
|
||||
set -l shell (getUserInfo defaultShell --json)
|
||||
|
||||
|
|
|
@ -82,7 +82,8 @@ $null = New-Module {
|
|||
}
|
||||
|
||||
return $false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $true;
|
||||
}
|
||||
};
|
||||
|
@ -145,7 +146,8 @@ $null = New-Module {
|
|||
|
||||
if ($ButtonSelector -is [string]) {
|
||||
$selector = [OpenQA.Selenium.By]::CssSelector($ButtonSelector);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$selector = $ButtonSelector;
|
||||
}
|
||||
|
||||
|
@ -156,7 +158,8 @@ $null = New-Module {
|
|||
|
||||
if ($element) {
|
||||
break;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Start-Sleep 1;
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +170,8 @@ $null = New-Module {
|
|||
|
||||
if ($element) {
|
||||
$Browser.FindElement($selector).Click();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Error "Unable to find download button!";
|
||||
}
|
||||
};
|
||||
|
|
|
@ -16,7 +16,8 @@ $null = New-Module {
|
|||
$profiles = & {
|
||||
if (-not $IsWindows -or (Test-Command "wsl")) {
|
||||
return Invoke-ConfigScript "getProfiles";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return Get-ChildItem "$PSScriptRoot/../../../.config" | ForEach-Object { Split-Path -LeafBase $_ };
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +37,8 @@ $null = New-Module {
|
|||
"Which profile do you wish to set up?";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
"Please select a profile:";
|
||||
}
|
||||
}),
|
||||
|
@ -51,7 +53,8 @@ $null = New-Module {
|
|||
|
||||
if ($choice -eq $profiles.Count) {
|
||||
exit;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$env:CONFIG_NAME = $profiles[$choice];
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +78,8 @@ $null = New-Module {
|
|||
if (-not $IsWindows) {
|
||||
$escapedPath = (fish -c 'string escape $argv' "$scriptPath");
|
||||
fish -c ". $escapedPath; $Script";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (-not $env:VALHALLA_FLAKE_ROOT) {
|
||||
$cleanup = { };
|
||||
$projectRoot = "$PSScriptRoot/../../..";
|
||||
|
@ -98,18 +102,21 @@ $null = New-Module {
|
|||
|
||||
if (-not $?) {
|
||||
Write-Error "The configuration could not be retrieved!";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$output;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (-not ($output -and ($output | Test-Json))) {
|
||||
Write-Error "The value ``$output`` is not valid JSON.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$output | ConvertFrom-Json;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$null;
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +196,8 @@ $null = New-Module {
|
|||
|
||||
if ((Get-Users) -contains $UserName) {
|
||||
Get-Config "$(Get-UserConfigRoot).$UserName.$Name";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,14 +22,15 @@ $null = New-Module {
|
|||
@("PSScriptAnalyzer")
|
||||
) + (& {
|
||||
if (-not $IsWindows) {
|
||||
@()
|
||||
} else {
|
||||
@();
|
||||
}
|
||||
else {
|
||||
@(
|
||||
@("KnownFolders"),
|
||||
@("PSWindowsUpdate"),
|
||||
@("LocalAccounts", $true),
|
||||
@("NuGet")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -185,7 +186,7 @@ $null = New-Module {
|
|||
$command = $args[0];
|
||||
$flags = ($args | Select-Object -Skip 1);
|
||||
& $command @flags;
|
||||
} -args $ArgumentList
|
||||
} -args $ArgumentList;
|
||||
}
|
||||
|
||||
New-Alias -Force "sudo" -Scope Global Invoke-Sudo;
|
||||
|
@ -284,12 +285,13 @@ $null = New-Module {
|
|||
|
||||
$initialized = $true;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if ($taskPending) {
|
||||
Start-OneShot;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
& $Action;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,10 +61,12 @@ function Write-PSScript {
|
|||
|
||||
if ($exists -and ($Append.IsPresent)) {
|
||||
Add-Content -Force $FileName "`n$content";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ((-not $exists) -or $Replace.IsPresent) {
|
||||
Set-Content -Force $FileName $content;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Host "The file ``$FileName`` already exists!";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ $null = New-Module {
|
|||
[InstallerAction] $Action = & {
|
||||
if ($null -ne $Action) {
|
||||
$Action;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
[InstallerAction]::Install;
|
||||
}
|
||||
};
|
||||
|
@ -47,7 +48,8 @@ $null = New-Module {
|
|||
|
||||
if ($null -ne $Name) {
|
||||
$DisplayName = "``$Name``";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$DisplayName = "unknown software";
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ end
|
|||
function selectProfile -S -a result
|
||||
source "$(status dirname)/../../../lib/modules/partition/select.fish"
|
||||
set -l file (mktemp)
|
||||
set -l header "NAME"
|
||||
set -l header NAME
|
||||
set -l profiles
|
||||
|
||||
getProfiles | jq ".[]" --raw-output0 | string split0 | while read profile
|
||||
|
@ -23,7 +23,7 @@ function selectProfile -S -a result
|
|||
end
|
||||
|
||||
function getProfiles -S
|
||||
source "$(status dirname)/eval-flake.fish";
|
||||
source "$(status dirname)/eval-flake.fish"
|
||||
evalFlake "" "" --apply "builtins.attrNames" --json
|
||||
end
|
||||
|
||||
|
@ -53,7 +53,7 @@ function getUserConfig -S -a name property
|
|||
end
|
||||
|
||||
function isSet -S -a property
|
||||
not test "$(getConfig "$property" --json)" = "null"
|
||||
not test "$(getConfig "$property" --json)" = null
|
||||
end
|
||||
|
||||
function isOSSet -S -a property
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/env fish
|
||||
function evalFlake --argument-names config property
|
||||
set -l argv $argv[3..]
|
||||
set -l flakePath "$(realpath (status dirname))/../../..";
|
||||
argparse --ignore-unknown "apply=" "json" -- $argv
|
||||
set -l flakePath "$(realpath (status dirname))/../../.."
|
||||
argparse --ignore-unknown "apply=" json -- $argv
|
||||
|
||||
if [ -z "$_flag_json" ]
|
||||
set -a argv --raw
|
||||
|
|
|
@ -19,23 +19,23 @@ begin
|
|||
function runInstallerAction -V dir -a name action
|
||||
source "$dir/config.fish"
|
||||
|
||||
if [ -z "$action" ] || [ "$action" = "install" ]
|
||||
if [ -z "$action" ] || [ "$action" = install ]
|
||||
if functions -q installSW
|
||||
echo "Installing `$name`..."
|
||||
installSW $argv[3..]
|
||||
end
|
||||
|
||||
runInstallerAction $name "configure"
|
||||
runInstallerAction $name configure
|
||||
|
||||
if not isConfigured || [ "$USER" != (getConfig "valhalla.setupUser.name") ]
|
||||
runInstallerAction $name userConfig
|
||||
end
|
||||
else if [ "$action" = "configure" ]
|
||||
else if [ "$action" = configure ]
|
||||
if functions -q configureSW
|
||||
echo "Configuring `$name`..."
|
||||
configureSW $argv[3..]
|
||||
end
|
||||
else if [ "$action" = "userConfig" ]
|
||||
else if [ "$action" = userConfig ]
|
||||
set -l user $argv[3]
|
||||
|
||||
if [ -z "$user" ]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
function installExtension -d "Installs a Chromium extension for the browser with the specified information" -a name dir bin policyDir extensionDir
|
||||
[ -n "$bin" ]
|
||||
or set -l bin "google-chrome-stable"
|
||||
or set -l bin google-chrome-stable
|
||||
[ -n "$policyDir" ]
|
||||
or set -l policyDir "/opt/google/chrome/extensions"
|
||||
or set -l policyDir /opt/google/chrome/extensions
|
||||
[ -n "$extensionDir" ]
|
||||
or set -l extensionDir "/usr/local/share/chromium-extensions"
|
||||
or set -l extensionDir /usr/local/share/chromium-extensions
|
||||
|
||||
set -l keyFile "$dir.pem"
|
||||
set -l extensionFile "$dir.crx"
|
||||
|
@ -26,7 +26,7 @@ function installExtension -d "Installs a Chromium extension for the browser with
|
|||
|
||||
# Install and configure extension
|
||||
begin
|
||||
set -l property "external_crx"
|
||||
set -l property external_crx
|
||||
sudo mkdir -p "$extensionDir"
|
||||
sudo cp "$extensionFile" "$destination"
|
||||
sudo chmod -R a+rx "$extensionDir"
|
||||
|
@ -40,7 +40,7 @@ function installExtension -d "Installs a Chromium extension for the browser with
|
|||
end
|
||||
|
||||
begin
|
||||
echo "null" | \
|
||||
echo null | \
|
||||
FILE="$destination" \
|
||||
VERSION="$extVersion" \
|
||||
jq '{ external_crx: env.FILE, external_version: env.VERSION }'
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
if [ "$XDG_SESSION_TYPE" == "wayland" ]
|
||||
then
|
||||
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
|
||||
export MOZ_ENABLE_WAYLAND=1
|
||||
else
|
||||
export MOZ_USE_XINPUT2=1
|
||||
|
|
|
@ -15,7 +15,7 @@ Start-SoftwareInstaller @args `
|
|||
"# Oh My Posh!",
|
||||
(Get-ScriptInitializer "oh-my-posh init pwsh"),
|
||||
(Get-ScriptInitializer "oh-my-posh completion powershell")
|
||||
) -join [System.Environment]::NewLine)
|
||||
) -join [System.Environment]::NewLine);
|
||||
} `
|
||||
-UserConfigurator {
|
||||
param(
|
||||
|
@ -32,7 +32,7 @@ Start-SoftwareInstaller @args `
|
|||
if ($IsWindows) {
|
||||
sudo -u "$user" pwsh -c 'Write-Host $env:AppData';
|
||||
} else {
|
||||
sudo -u "$user" bash -c 'realpath ~/.config'
|
||||
sudo -u "$user" bash -c 'realpath ~/.config';
|
||||
}
|
||||
})/oh-my-posh";
|
||||
|
||||
|
@ -43,7 +43,8 @@ Start-SoftwareInstaller @args `
|
|||
& {
|
||||
if ($IsWindows) {
|
||||
wsl cat $info.source | Out-String;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Get-Content -Raw $info.source;
|
||||
}
|
||||
}));
|
||||
|
@ -52,7 +53,7 @@ Start-SoftwareInstaller @args `
|
|||
}
|
||||
|
||||
foreach ($additionalTheme in (Get-UserConfig -UserName "$user" "oh-my-posh.additionalThemes")) {
|
||||
Write-Host "creating theme $additionalTheme"
|
||||
Write-Host "creating theme $additionalTheme";
|
||||
$null = New-Theme $additionalTheme;
|
||||
}
|
||||
|
||||
|
@ -65,7 +66,8 @@ Start-SoftwareInstaller @args `
|
|||
|
||||
if ($IsWindows) {
|
||||
[System.Environment]::SetEnvironmentVariable($varName, "%AppData%/$([System.IO.Path]::GetRelativePath($env:AppData, $theme))", "User");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
. "$PSScriptRoot/../aliae/Manage.ps1";
|
||||
$value = $theme;
|
||||
$relativePath = sudo -u "$user" fish -c 'realpath --relative-base ~ $argv' $theme;
|
||||
|
|
|
@ -12,13 +12,13 @@ begin
|
|||
'set -x POSH_THEME $POSH_THEME' \
|
||||
"oh-my-posh init fish | source" \
|
||||
"oh-my-posh completion fish | source"
|
||||
end | installFishProfile "oh-my-posh"
|
||||
end | installFishProfile oh-my-posh
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
'eval "$(oh-my-posh init bash)"' \
|
||||
'eval "$(oh-my-posh completion bash)"'
|
||||
end | installBashProfile "oh-my-posh"
|
||||
end | installBashProfile oh-my-posh
|
||||
|
||||
sudo -HE pwsh "$dir/Manage.ps1" Configure
|
||||
end
|
||||
|
|
|
@ -9,7 +9,8 @@ Start-SoftwareInstaller @args `
|
|||
|
||||
if (-not $IsWindows) {
|
||||
$globalDir = '"/etc/powershell/conf.d"';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$globalDir = '"$env:ProgramData/PowerShell/conf.d"';
|
||||
}
|
||||
|
||||
|
|
|
@ -53,16 +53,19 @@ $null = New-Module {
|
|||
if ($IsWindows) {
|
||||
# ToDo Change to "PowerShell"
|
||||
$configRoot = "$env:ProgramData";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$configRoot = "/etc";
|
||||
}
|
||||
|
||||
$profiles = @("$configRoot/powershell/.");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ($DefaultUser) {
|
||||
if (-not $IsWindows) {
|
||||
$HomeDir = "/etc/skel";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$HomeDir = "C:/Users/Default";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ Start-SoftwareInstaller @args `
|
|||
$userPath = & {
|
||||
if ($env:ALIAE_CONFIG) {
|
||||
$env:ALIAE_CONFIG;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
"~/.aliae.yaml";
|
||||
}
|
||||
};
|
||||
|
|
|
@ -26,8 +26,8 @@ $null = New-Module {
|
|||
Name = "$Name";
|
||||
Value = "$Value";
|
||||
} `
|
||||
".alias |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]" `
|
||||
-User $User;
|
||||
-User $User `
|
||||
".alias |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]";
|
||||
}
|
||||
|
||||
<#
|
||||
|
@ -52,8 +52,8 @@ $null = New-Module {
|
|||
Name = "$Name";
|
||||
Value = "$Value";
|
||||
} `
|
||||
".env |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]" `
|
||||
-User $User;
|
||||
-User $User `
|
||||
".env |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]";
|
||||
}
|
||||
|
||||
<#
|
||||
|
@ -78,7 +78,8 @@ $null = New-Module {
|
|||
if ($User) {
|
||||
$flags = @("-u", "$User")
|
||||
$path = "$($IsWindows ? "~" : "$(sudo @flags bash -c "realpath ~")")/.aliae.yaml";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$path = Get-GlobalConfigPath;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,37 +6,37 @@ begin
|
|||
function configureSW -V dir
|
||||
source "$dir/../bash/profile.fish"
|
||||
source "$dir/../fish/profile.fish"
|
||||
set -l file (pwsh -CommandWithArgs '. $args[0]; Get-GlobalConfigPath' "$dir/Constants.ps1");
|
||||
set -l file (pwsh -CommandWithArgs '. $args[0]; Get-GlobalConfigPath' "$dir/Constants.ps1")
|
||||
sudo install -Dm644 "$dir/aliae.yml" "$file"
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"if [ -f $(string escape $file) ]" \
|
||||
'then' \
|
||||
then \
|
||||
" eval \"\$(aliae init bash --config $(string escape $file))\"" \
|
||||
'fi' \
|
||||
fi \
|
||||
'' \
|
||||
'if [ -n "$ALIAE_CONFIG" ] && [ -f "$ALIAE_CONFIG" ] || [ -f ~/.aliae.yaml ]' \
|
||||
'then' \
|
||||
then \
|
||||
' eval "$(aliae init bash)"' \
|
||||
'fi' \
|
||||
fi \
|
||||
'' \
|
||||
'eval "$(aliae completion bash)"'
|
||||
end | installBashProfile "aliae" "aliae"
|
||||
end | installBashProfile aliae aliae
|
||||
|
||||
if type -q fish
|
||||
begin
|
||||
printf %s\n \
|
||||
"if [ -f $(string escape $file) ]" \
|
||||
" eval \"\$(aliae init bash --config $(string escape $file))\"" \
|
||||
'end' \
|
||||
end \
|
||||
'' \
|
||||
'if [ -n "$ALIAE_CONFIG" ] && [ -f "$ALIAE_CONFIG" ] || [ -f ~/.aliae.yaml ]' \
|
||||
' aliae init fish | source' \
|
||||
'end' \
|
||||
end \
|
||||
'' \
|
||||
"aliae completion fish | source"
|
||||
end | installFishProfile "aliae" "aliae"
|
||||
end | installFishProfile aliae aliae
|
||||
end
|
||||
|
||||
sudo -HE pwsh "$dir/Main.ps1" Configure
|
||||
|
|
|
@ -9,7 +9,7 @@ begin
|
|||
"" \
|
||||
"# profile" \
|
||||
"while IFS= read -r -d '' file;" \
|
||||
"do" \
|
||||
do \
|
||||
' source "$file";' \
|
||||
'done < <(find {/etc,~/.config}/bash/conf.d/* -print0 2> /dev/null);'
|
||||
end | sudo tee -a /etc/bash.bashrc &>/dev/null
|
||||
|
|
|
@ -14,13 +14,13 @@ begin
|
|||
printf %s\n \
|
||||
"" \
|
||||
'if test "$BASH"' \
|
||||
"then"
|
||||
then
|
||||
|
||||
echo "$statements" | while read -l line
|
||||
echo " $line"
|
||||
end
|
||||
|
||||
echo "fi"
|
||||
echo fi
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
$getConfig = { Get-UserConfig -UserName $User @args };
|
||||
$sudoArgs = @("-u", $User);
|
||||
$configArgs = @("--global");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$getConfig = { Get-OSConfig @args };
|
||||
$sudoArgs = @();
|
||||
$configArgs = @("--system");
|
||||
|
@ -69,7 +70,7 @@
|
|||
} | Out-Null;
|
||||
|
||||
if ($mainBranch) {
|
||||
git -C "$dir" branch $mainBranch | Out-Null;;
|
||||
git -C "$dir" branch $mainBranch | Out-Null;
|
||||
sudo @sudoArgs git -C "$dir" flow config set @configArgs master $mainBranch;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ begin
|
|||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -V dir
|
||||
source "$dir/../bash/profile.fish";
|
||||
source "$dir/../fish/profile.fish";
|
||||
source "$dir/../bash/profile.fish"
|
||||
source "$dir/../fish/profile.fish"
|
||||
set -l functionName _PortValhalla_ls_
|
||||
|
||||
function dump_header
|
||||
|
@ -34,7 +34,7 @@ begin
|
|||
""
|
||||
|
||||
dump_aliases
|
||||
end | installBashProfile "logo-ls"
|
||||
end | installBashProfile logo-ls
|
||||
|
||||
if type -q fish
|
||||
begin
|
||||
|
@ -47,11 +47,11 @@ begin
|
|||
" else" \
|
||||
' command ls --color=auto $argv' \
|
||||
" end" \
|
||||
"end" \
|
||||
end \
|
||||
""
|
||||
|
||||
dump_aliases
|
||||
end | installFishProfile "logo-ls"
|
||||
end | installFishProfile logo-ls
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -11,11 +11,10 @@ sleep_secs="1"
|
|||
# * 'ehci-pci' - USB 2.0
|
||||
# * 'xhci_hcd' - USB 3.0
|
||||
echo "Looking for USB standards ..."
|
||||
for usb_std in "$base/"?hci[-_]?c*
|
||||
do
|
||||
for usb_std in "$base/"?hci[-_]?c*; do
|
||||
echo "* USB standard '$usb_std' ..."
|
||||
for dev_path in "$usb_std/"*:*
|
||||
do
|
||||
|
||||
for dev_path in "$usb_std/"*:*; do
|
||||
dev="$(basename "$dev_path")"
|
||||
echo " - Resetting device '$dev' ..."
|
||||
printf '%s' "$dev" | sudo tee "$usb_std/unbind" >/dev/null
|
||||
|
@ -23,6 +22,7 @@ do
|
|||
printf '%s' "$dev" | sudo tee "$usb_std/bind" >/dev/null
|
||||
echo " done."
|
||||
done
|
||||
|
||||
echo " done."
|
||||
done
|
||||
echo "done."
|
||||
|
|
|
@ -17,10 +17,10 @@ begin
|
|||
'export PYENV_ROOT="$HOME/.pyenv"' \
|
||||
'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' \
|
||||
'eval "$(pyenv init -)"'
|
||||
end | installBashProfile "pyenv" > /dev/null
|
||||
end | installBashProfile pyenv >/dev/null
|
||||
|
||||
if type -q fish
|
||||
installFishProfile "pyenv" "pyenv" "pyenv init - | source"
|
||||
installFishProfile pyenv pyenv "pyenv init - | source"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ begin
|
|||
set -l configs (getUserConfig "$name" "$key" --apply "builtins.attrNames" --json)
|
||||
|
||||
if [ (echo "$configs" | jq "length") -gt 0 ]
|
||||
if [ "$XDG_SESSION_TYPE" = "tty" ]
|
||||
if [ "$XDG_SESSION_TYPE" = tty ]
|
||||
set -l sessionPid
|
||||
set -l freeTty
|
||||
set -l service
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0483", MODE="0666"';
|
||||
end | sudo tee /etc/udev/rules.d/50-ct-board.rules > /dev/null;
|
||||
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0483", MODE="0666"'
|
||||
end | sudo tee /etc/udev/rules.d/50-ct-board.rules >/dev/null
|
||||
|
|
|
@ -9,7 +9,7 @@ begin
|
|||
|
||||
if not grep "\b$indicator\b" "$configFile" >/dev/null
|
||||
# As described in https://wiki.archlinux.org/title/Vim#Clipboard
|
||||
echo "$indicator+=unnamed,unnamedplus" | sudo tee -a "$configFile" > /dev/null;
|
||||
echo "$indicator+=unnamed,unnamedplus" | sudo tee -a "$configFile" >/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ begin
|
|||
function configureSW -V dir
|
||||
source "$dir/../bash/profile.fish"
|
||||
source "$dir/../fish/profile.fish"
|
||||
echo 'eval "$(zoxide init bash)"' | installBashProfile "zoxide"
|
||||
echo "zoxide init fish | source" | installFishProfile "zoxide"
|
||||
echo 'eval "$(zoxide init bash)"' | installBashProfile zoxide
|
||||
echo "zoxide init fish | source" | installFishProfile zoxide
|
||||
sudo -HE pwsh -NoProfile "$dir/Main.ps1" Configure
|
||||
end
|
||||
|
||||
|
|
|
@ -63,10 +63,10 @@ $null = New-Module {
|
|||
& {
|
||||
switch ($Action) {
|
||||
([WindowsInstallerAction]::Backup) {
|
||||
"Please select the path you wish to store your backup at"
|
||||
"Please select the path you wish to store your backup at";
|
||||
}
|
||||
([WindowsInstallerAction]::Install) {
|
||||
"Please select an archive you wish to restore from, if you wish to restore from a backup"
|
||||
"Please select an archive you wish to restore from, if you wish to restore from a backup";
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
@ -183,7 +183,8 @@ $null = New-Module {
|
|||
Disable-Autologin;
|
||||
Restart-Intermediate;
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Deploy-SoftwareAction -Action ([InstallerAction]::BackupUser);
|
||||
Remove-LocalGroupMember -Member "$user" @adminGroup;
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ function Start-Setup {
|
|||
}
|
||||
|
||||
function Get-PathInjection($path) {
|
||||
"(Join-Path `$env:SystemDrive $(ConvertTo-Injection $path))"
|
||||
"(Join-Path `$env:SystemDrive $(ConvertTo-Injection $path))";
|
||||
}
|
||||
|
||||
function Get-ScriptPathInjection($path) {
|
||||
Get-PathInjection (Get-RemoteScriptPath $path)
|
||||
Get-PathInjection (Get-RemoteScriptPath $path);
|
||||
}
|
||||
|
||||
function Get-DiskConfig {
|
||||
|
@ -104,7 +104,8 @@ function Start-Setup {
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($config in @(@($diskInfo.PartitionCreations, @("Order")),
|
||||
foreach ($config in @(
|
||||
@($diskInfo.PartitionCreations, @("Order")),
|
||||
@($diskInfo.PartitionModifications, @("Order", "PartitionID")))) {
|
||||
foreach ($partition in $config[0]) {
|
||||
foreach ($property in $config[1]) {
|
||||
|
@ -261,8 +262,8 @@ function Start-Setup {
|
|||
$unattendedConfig.PreserveWhitespace = $true;
|
||||
$unattendedConfig.Save($unattendedConfigFile);
|
||||
|
||||
Write-Warning "Attention: This program will completely wipe your current disk #1 and install Windows on it. Are you sure you want to do this?"
|
||||
Read-Host -Prompt "Hit enter to continue or CTRL+C to abort"
|
||||
Write-Warning "Attention: This program will completely wipe your current disk #1 and install Windows on it. Are you sure you want to do this?";
|
||||
Read-Host -Prompt "Hit enter to continue or CTRL+C to abort";
|
||||
& "$SETUP_DRIVE\setup.exe" /Unattend:$unattendedConfigFile;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ $null = New-Module {
|
|||
}
|
||||
|
||||
"$rootSelector/$associationSelector$filter";
|
||||
}
|
||||
};
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
@ -64,7 +64,8 @@ $null = New-Module {
|
|||
|
||||
if ($candidates.Count -eq 1) {
|
||||
$association = $candidates[0];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$association = $document.SelectSingleNode($rootSelector).AppendChild($document.CreateElement($associationElementName));
|
||||
|
||||
foreach ($attributeName in @("Identifier", "ProgId", "ApplicationName")) {
|
||||
|
@ -95,7 +96,7 @@ $null = New-Module {
|
|||
$associations = $root.SelectNodes((& $getSelector));
|
||||
|
||||
# Reorder associations by their Identifier
|
||||
$null = $associations | ForEach-Object { $root.RemoveChild($_) } | Sort-Object -Property "Identifier" | ForEach-Object { $root.AppendChild($_); };
|
||||
$null = $associations | ForEach-Object { $root.RemoveChild($_) } | Sort-Object -Property "Identifier" | ForEach-Object { $root.AppendChild($_) };
|
||||
|
||||
$configFile = New-TemporaryFile;
|
||||
$writerSettings = [XmlWriterSettings]::new();
|
||||
|
|
|
@ -21,7 +21,8 @@ function Deploy-SoftwareAction {
|
|||
if ($null -ne $Action) {
|
||||
$install = ($Action -eq ([InstallerAction]::Install));
|
||||
$null = $arguments.Add("action", $Action);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$install = $true;
|
||||
}
|
||||
|
||||
|
@ -138,7 +139,7 @@ function Deploy-SoftwareAction {
|
|||
keepass `
|
||||
;
|
||||
|
||||
Install-ChocoPackage bitwarden -ArgumentList '--install-arguments="/ALLUSERS=1"'
|
||||
Install-ChocoPackage bitwarden -ArgumentList '--install-arguments="/ALLUSERS=1"';
|
||||
|
||||
Install-WingetPackage `
|
||||
SomePythonThings.WingetUIStore `
|
||||
|
|
|
@ -12,7 +12,7 @@ function Invoke-Hook() {
|
|||
|
||||
if (Get-Command "$Name" -ErrorAction SilentlyContinue) {
|
||||
$parameters = {
|
||||
fallback = $scriptBlock
|
||||
fallback = $scriptBlock;
|
||||
};
|
||||
|
||||
Write-Host "Running Hook ``$Name``";
|
||||
|
|
|
@ -30,13 +30,15 @@ $null = New-Module {
|
|||
|
||||
if ($UserKey) {
|
||||
$path = Join-Path ($UserKey.PSPath) $runOncePath;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$path = $systemRunOncePath;
|
||||
}
|
||||
|
||||
if (-not (Test-Path $path)) {
|
||||
New-Item $path;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Get-Item $path;
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +153,8 @@ $null = New-Module {
|
|||
}
|
||||
|
||||
$key = Get-RunOnceKey $UserKey;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$key = Get-RunOnceKey;
|
||||
}
|
||||
|
||||
|
@ -232,9 +235,11 @@ $null = New-Module {
|
|||
if (-not $NoRegister.IsPresent) {
|
||||
if ($DefaultUser.IsPresent) {
|
||||
Register-Setup -DefaultUser;
|
||||
} elseif ($CurrentUser.IsPresent) {
|
||||
}
|
||||
elseif ($CurrentUser.IsPresent) {
|
||||
Register-Setup -User;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Register-Setup;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,8 @@ $null = New-Module {
|
|||
[AccessControlType]::Allow));
|
||||
|
||||
Set-Acl $configRoot $acl;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$key = Get-Item $configRoot;
|
||||
}
|
||||
|
||||
|
@ -141,7 +142,8 @@ $null = New-Module {
|
|||
|
||||
if ($key.GetValueNames().Contains($Name)) {
|
||||
return $key.GetValue($Name);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $null;
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +168,8 @@ $null = New-Module {
|
|||
|
||||
if ($null -eq $Value) {
|
||||
Remove-ItemProperty $key -Name $Name;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$null = Set-ItemProperty $key -Name $Name -Value $Value;
|
||||
}
|
||||
}
|
||||
|
@ -371,4 +374,4 @@ $null = New-Module {
|
|||
|
||||
Set-SetupOption $finishedOption $true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -12,7 +12,8 @@ $null = New-Module {
|
|||
|
||||
if ($User) {
|
||||
$result = "Users/$User";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = "System";
|
||||
}
|
||||
|
||||
|
@ -89,7 +90,8 @@ $null = New-Module {
|
|||
|
||||
if (Test-Path -PathType Container $Source) {
|
||||
$null = New-Item -ItemType Junction $fullPath -Target $Source;
|
||||
} elseif (Test-Path -PathType Leaf $Source) {
|
||||
}
|
||||
elseif (Test-Path -PathType Leaf $Source) {
|
||||
Copy-Item $Source $fullPath;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ $null = New-Module {
|
|||
)
|
||||
|
||||
Set-ItemProperty -Path $systemPolicyPath -Name $uacOption -Value ([int]$Value);
|
||||
}
|
||||
};
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
@ -58,7 +58,8 @@ $null = New-Module {
|
|||
(& {
|
||||
if (Test-Path -PathType Container $Path) {
|
||||
[InheritanceFlags]::ObjectInherit -bor [InheritanceFlags]::ContainerInherit
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
0
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -49,7 +49,7 @@ $null = New-Module {
|
|||
|
||||
[string[]] $arguments = $ArgumentList + (& {
|
||||
if ($Action -eq 'install') {
|
||||
@("--accept-package-agreements")
|
||||
@("--accept-package-agreements");
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -75,7 +75,7 @@ $null = New-Module {
|
|||
|
||||
$? -and -not ([System.Linq.Enumerable]::Any(
|
||||
[string[]]($output),
|
||||
[System.Func[string,bool]]{ param($line) $line -eq "Cancelled"; }));
|
||||
[System.Func[string, bool]] { param($line) $line -eq "Cancelled" }));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ $null = New-Module {
|
|||
[OutputType([bool])]
|
||||
param(
|
||||
[string] $Name
|
||||
);
|
||||
)
|
||||
|
||||
-not [string]::IsNullOrEmpty((choco list --limit-output --exact $name));
|
||||
}
|
||||
|
@ -132,9 +132,10 @@ $null = New-Module {
|
|||
& $chocoRunner @PSBoundParameters -Guard {
|
||||
param($Name)
|
||||
if (Test-ChocoPackage $Name) {
|
||||
Write-Host "Package ``$Name`` is already installed"
|
||||
Write-Host "Package ``$Name`` is already installed";
|
||||
$false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$true;
|
||||
}
|
||||
};
|
||||
|
@ -157,7 +158,8 @@ $null = New-Module {
|
|||
param($Name)
|
||||
if (Test-ChocoPackage $Name) {
|
||||
$true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Host "Package ``$Name`` is not installed";
|
||||
$false;
|
||||
}
|
||||
|
@ -181,13 +183,13 @@ $null = New-Module {
|
|||
[string[]] $AdditionalNames = @()
|
||||
)
|
||||
|
||||
& $wingetRunner @PSBoundParameters `
|
||||
-Guard {
|
||||
& $wingetRunner @PSBoundParameters -Guard {
|
||||
param($Name, $Parameters)
|
||||
if (Test-WingetPackage -Name $Name @Parameters) {
|
||||
Write-Host "Package ``$Name`` is already installed"
|
||||
Write-Host "Package ``$Name`` is already installed";
|
||||
$false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$true;
|
||||
}
|
||||
};
|
||||
|
@ -210,8 +212,9 @@ $null = New-Module {
|
|||
param($Name, $Parameters)
|
||||
if (Test-WingetPackage -Name $Name @Parameters) {
|
||||
$true;
|
||||
} else {
|
||||
Write-Host "Package ``$Name`` is not installed"
|
||||
}
|
||||
else {
|
||||
Write-Host "Package ``$Name`` is not installed";
|
||||
$false;
|
||||
}
|
||||
};
|
||||
|
@ -249,7 +252,8 @@ $null = New-Module {
|
|||
|
||||
Write-Host "Downloading setup file from ``$Source``";
|
||||
Invoke-WebRequest $Source -OutFile $filePath;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$filePath = $Source;
|
||||
}
|
||||
|
||||
|
@ -321,7 +325,8 @@ $null = New-Module {
|
|||
|
||||
try {
|
||||
& $download;
|
||||
} catch {
|
||||
}
|
||||
catch {
|
||||
$null = $Browser.ExecuteScript("document.querySelector('$cookieBannerSelector').remove()");
|
||||
& $download;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@ $null = New-Module {
|
|||
|
||||
if ($task) {
|
||||
return [OneShotTask]$task;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ function Update-WindowsInstallation {
|
|||
Write-Host "A Reboot is Required!";
|
||||
Write-Host "Windows will reboot now and the installation will be continued automatically.";
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Host "Updating Windows finished successfully!";
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -44,12 +44,14 @@ $null = New-Module {
|
|||
|
||||
if ($msAccount) {
|
||||
logoff;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Restart-Intermediate;
|
||||
}
|
||||
|
||||
exit;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ($msAccount) {
|
||||
if (-not (Test-Admin)) {
|
||||
Invoke-OneShot DisableUAC;
|
||||
|
@ -166,7 +168,8 @@ $null = New-Module {
|
|||
0) -eq 1) {
|
||||
return $newUser;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = $Host.UI.PromptForChoice(
|
||||
"Select your User",
|
||||
"Which one is your user?",
|
||||
|
@ -184,7 +187,8 @@ $null = New-Module {
|
|||
return $newUsers[$result - 1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Host "";
|
||||
Write-Host "Unable to determine the new user";
|
||||
Write-Host "Retrying…";
|
||||
|
@ -218,7 +222,8 @@ $null = New-Module {
|
|||
Add-MicrosoftAccount $Name;
|
||||
Set-SetupOption $loggedInUserOption $env:UserName;
|
||||
Invoke-OneShot ([OneShotTask]::InitializeMSAccount);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
New-LocalUser -NoPassword $Name;
|
||||
Set-LocalUser $Name -PasswordNeverExpires $true;
|
||||
Set-LocalUser $Name -PasswordNeverExpires $false;
|
||||
|
@ -246,7 +251,7 @@ $null = New-Module {
|
|||
|
||||
if ($msAccount) {
|
||||
$accountName = Get-MSAccountName;
|
||||
Write-Host "Renaming ``$accountName`` to ``$name``…"
|
||||
Write-Host "Renaming ``$accountName`` to ``$name``…";
|
||||
Rename-LocalUser $accountName $name;
|
||||
}
|
||||
|
||||
|
@ -254,7 +259,8 @@ $null = New-Module {
|
|||
|
||||
if ($msAccount) {
|
||||
Disable-LocalUser (Get-SetupOption $loggedInUserOption);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Disable-LocalUser $env:UserName;
|
||||
}
|
||||
|
||||
|
@ -266,7 +272,8 @@ $null = New-Module {
|
|||
if ($msAccount) {
|
||||
Disable-Autologin;
|
||||
Set-BootMessage -Caption "Please Log In" -Message "Please log in using your new Microsoft Account ``$name``.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Set-AutologinUser "$name";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,19 +13,19 @@
|
|||
param()
|
||||
|
||||
$hubName = "lghub_system_tray.exe";
|
||||
|
||||
$candidates = Get-Process | Where-Object { $_.Path -and ((Split-Path -Leaf $_.Path) -eq $hubName) };
|
||||
|
||||
if ($candidates.Count -gt 0) {
|
||||
$lghubPath = $candidates[0].Path;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$lghubPath = $null;
|
||||
}
|
||||
|
||||
$mainProcesses = Get-Process | Where-Object {
|
||||
$_.Path -and
|
||||
(@("lghub.exe", "lghub_agent.exe", "lghub_updater.exe", $hubName) -contains (Split-Path -Leaf $_.Path)) -and
|
||||
(($_.Parent.ProcessName -eq "explorer") -or ($null -eq $_.Parent))
|
||||
(($_.Parent.ProcessName -eq "explorer") -or ($null -eq $_.Parent));
|
||||
};
|
||||
|
||||
$null = $mainProcesses | ForEach-Object { $_.Kill($true) };
|
||||
|
@ -64,7 +64,7 @@
|
|||
|
||||
Edit-LGHubConfig {
|
||||
Add-BackupArtifacts -User $Arguments.Name -Source $configPath -Path "$Name" `
|
||||
-Include @("settings.db", "icon_cache")
|
||||
-Include @("settings.db", "icon_cache");
|
||||
};
|
||||
} `
|
||||
-UserConfigurator {
|
||||
|
|
|
@ -6,7 +6,7 @@ using namespace Microsoft.Win32;
|
|||
|
||||
Start-SoftwareInstaller @args `
|
||||
-Installer {
|
||||
Install-ChocoPackage thunderbird -ArgumentList "--params",'"/NoTaskbarShortcut /NoDesktopShortcut"'
|
||||
Install-ChocoPackage thunderbird -ArgumentList "--params", '"/NoTaskbarShortcut /NoDesktopShortcut"';
|
||||
} `
|
||||
-Configurator {
|
||||
Write-Host "Making Thunderbird the default mail program…";
|
||||
|
|
|
@ -6,7 +6,7 @@ Start-SoftwareInstaller @args `
|
|||
-Installer {
|
||||
Write-Information "Downgrading AutoHotkey…";
|
||||
$id = "AutoHotkey.AutoHotkey";
|
||||
$uninstall = { winget uninstall --accept-source-agreements -e --id "$id"; };
|
||||
$uninstall = { winget uninstall --accept-source-agreements -e --id "$id" };
|
||||
& $uninstall;
|
||||
Install-WingetPackage $id -ArgumentList "--version", "1.1.37.00";
|
||||
Install-ChocoPackage temurin11jre;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
$getInstallPath = {
|
||||
return "$((Get-KnownFolder -SpecialFolder ProgramFilesX86).Path)/osu!";
|
||||
}
|
||||
};
|
||||
|
||||
Start-SoftwareInstaller @args `
|
||||
-Installer {
|
||||
|
|
|
@ -6,6 +6,6 @@ begin
|
|||
cp "$dir/.git/config" "$target/.git/config"
|
||||
git -C "$dir" diff HEAD | git -C "$target" apply --allow-empty &>/dev/null
|
||||
|
||||
and git -C "$dir" ls-files --exclude-standard --others | \
|
||||
and git -C "$dir" ls-files --exclude-standard --others |
|
||||
rsync --files-from=/dev/stdin "$dir" "$target"
|
||||
end
|
||||
|
|
|
@ -22,14 +22,14 @@ begin
|
|||
sed "s/\//\\\\/g"
|
||||
end
|
||||
|
||||
argparse --name (status filename) -x "iso,usb" "iso" "usb" "debug" -- $argv
|
||||
argparse --name (status filename) -x "iso,usb" iso usb debug -- $argv
|
||||
or exit 1
|
||||
|
||||
set -l mountDir "/mnt"
|
||||
set -l setupLabel "winiso-valhalla"
|
||||
set -l projectPath "PortValhalla"
|
||||
set -l mountDir /mnt
|
||||
set -l setupLabel winiso-valhalla
|
||||
set -l projectPath PortValhalla
|
||||
set -l systemDrivePath "sources/\$OEM\$/\$1"
|
||||
set -l pwshPath "pwsh"
|
||||
set -l pwshPath pwsh
|
||||
set -l localProjectPath "$systemDrivePath/$projectPath"
|
||||
set -l cacheDir ~/.cache/winiso-valhalla
|
||||
set -l winpe "$cacheDir/winpe.iso"
|
||||
|
@ -56,22 +56,27 @@ begin
|
|||
|
||||
set -l files
|
||||
|
||||
set -l fileDefinitions \
|
||||
set -l fileDefinitions (
|
||||
# Intel LAN driver
|
||||
) \
|
||||
drivers/network/intel \
|
||||
"https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Intel_I211_UWD_TP_W10_64_VER12151841_20190306R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA" \
|
||||
zip \
|
||||
. \
|
||||
\
|
||||
. (
|
||||
# Marvell LAN driver
|
||||
) \
|
||||
drivers/network/marvell \
|
||||
"https://dlcdnets.asus.com/pub/ASUS/mb/04LAN/DRV_LAN_Marvell_TP_TSD_W11_64_V3130_20211118R.zip?model=ROG%20ZENITH%20EXTREME%20ALPHA" \
|
||||
zip \
|
||||
./x64 \
|
||||
\
|
||||
./x64 (
|
||||
# Git
|
||||
) \
|
||||
software/git \
|
||||
"https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/PortableGit-2.41.0-64-bit.7z.exe" \
|
||||
exe \
|
||||
. \
|
||||
\
|
||||
. (
|
||||
# PowerShell Core
|
||||
) \
|
||||
software/pwsh \
|
||||
"https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/PowerShell-7.3.7-win-x64.zip" \
|
||||
zip \
|
||||
|
@ -157,7 +162,7 @@ begin
|
|||
"echo Loading Drivers..." \
|
||||
'pwsh -file "X:\Scripts\Drivers.ps1"' \
|
||||
"echo Configuring Network..." \
|
||||
"wpeinit" \
|
||||
wpeinit \
|
||||
"echo Configuring keyboard layout..." \
|
||||
"wpeutil SetKeyboardLayout 0807:00000807" \
|
||||
"echo Disabling Energy Saving Mode..." \
|
||||
|
@ -180,7 +185,7 @@ begin
|
|||
and chmod u+w (dirname "$wimFile")
|
||||
and chmod u+w "$wimFile"
|
||||
|
||||
and while [ ! (wiminfo "$wimFile" 1 | grep "^$editionField" | cut -d ":" -f2 | string trim) = "Professional" ]
|
||||
and while [ ! (wiminfo "$wimFile" 1 | grep "^$editionField" | cut -d ":" -f2 | string trim) = Professional ]
|
||||
wimdelete --soft "$wimFile" 1
|
||||
end
|
||||
|
||||
|
@ -250,7 +255,7 @@ begin
|
|||
chooseDisk winDisk
|
||||
and echo "Proceeding will cause the disk `$winDisk` to be wiped."
|
||||
|
||||
and if ! confirm "Are you sure you want to continue?" "n"
|
||||
and if ! confirm "Are you sure you want to continue?" n
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
@ -271,7 +276,7 @@ begin
|
|||
set -l diskPath (find -L /dev/disk/by-diskseq -samefile $winDisk)
|
||||
set -l bootDisk "$diskPath-part1"
|
||||
set -l dataDisk "$diskPath-part2"
|
||||
and sudo mkfs.fat -F 32 -n "BOOT" "$bootDisk"
|
||||
and sudo mkfs.fat -F 32 -n BOOT "$bootDisk"
|
||||
and sudo mkfs.ntfs -fFL "$setupLabel" "$dataDisk"
|
||||
and sudo mount --mkdir "$bootDisk" "$bootPath"
|
||||
and sudo mount --mkdir "$dataDisk" "$dataPath"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
$env:SETUP_DRIVE = (ConvertFrom-Csv ((wmic volume where "Label='$env:SETUP_LABEL'" get DriveLetter) | ForEach-Object { "$_".Trim(); })).DriveLetter;
|
||||
$env:SETUP_DRIVE = (ConvertFrom-Csv ((wmic volume where "Label='$env:SETUP_LABEL'" get DriveLetter) | ForEach-Object { "$_".Trim() })).DriveLetter;
|
||||
Set-Location (Join-Path $env:SETUP_DRIVE $env:LOCAL_PROJECT_PATH)
|
||||
& ./scripts/Windows/OS/Setup.ps1;
|
||||
|
|
Loading…
Reference in a new issue