mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-09 20:33:15 -06:00
Compare commits
11 commits
ac49626118
...
79984d5ddc
Author | SHA1 | Date | |
---|---|---|---|
79984d5ddc | |||
db01189615 | |||
da682c0073 | |||
df4da6b3f9 | |||
cb31371784 | |||
0a54af8cc7 | |||
e4a304c274 | |||
91a370de41 | |||
b0bffa1a1f | |||
884bc993ec | |||
805f1c19b3 |
11 changed files with 94 additions and 110 deletions
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
|
@ -57,7 +57,6 @@ jobs:
|
||||||
build --minimal \
|
build --minimal \
|
||||||
--host "${{ inputs.hosts }}" \
|
--host "${{ inputs.hosts }}" \
|
||||||
--flake . \
|
--flake . \
|
||||||
--verbose \
|
|
||||||
--debug \
|
--debug \
|
||||||
-- \
|
-- \
|
||||||
--print-build-logs
|
--print-build-logs
|
||||||
|
|
5
.github/workflows/update.yml
vendored
5
.github/workflows/update.yml
vendored
|
@ -22,6 +22,7 @@ jobs:
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@v13
|
- uses: DeterminateSystems/nix-installer-action@v13
|
||||||
with:
|
with:
|
||||||
|
source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
|
||||||
extra-conf: |
|
extra-conf: |
|
||||||
accept-flake-config = true
|
accept-flake-config = true
|
||||||
|
|
||||||
|
@ -43,7 +44,6 @@ jobs:
|
||||||
build --minimal \
|
build --minimal \
|
||||||
--host "othalan" \
|
--host "othalan" \
|
||||||
--flake . \
|
--flake . \
|
||||||
--verbose \
|
|
||||||
--debug \
|
--debug \
|
||||||
-- \
|
-- \
|
||||||
--print-build-logs
|
--print-build-logs
|
||||||
|
@ -86,7 +86,6 @@ jobs:
|
||||||
-- \
|
-- \
|
||||||
build $system_attr \
|
build $system_attr \
|
||||||
--flake . \
|
--flake . \
|
||||||
--verbose \
|
|
||||||
--debug \
|
--debug \
|
||||||
-- \
|
-- \
|
||||||
--print-build-logs \
|
--print-build-logs \
|
||||||
|
@ -101,9 +100,9 @@ jobs:
|
||||||
-- \
|
-- \
|
||||||
build $system_attr \
|
build $system_attr \
|
||||||
--flake . \
|
--flake . \
|
||||||
--verbose \
|
|
||||||
--debug \
|
--debug \
|
||||||
-- \
|
-- \
|
||||||
|
--keep-going \
|
||||||
--print-build-logs \
|
--print-build-logs \
|
||||||
--out-link updated
|
--out-link updated
|
||||||
|
|
||||||
|
|
82
flake.lock
82
flake.lock
|
@ -341,11 +341,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722519799,
|
"lastModified": 1722956902,
|
||||||
"narHash": "sha256-NXeB/KgCbklksgTfHNef0/CfTXmw88YOrh2Q/87S2RM=",
|
"narHash": "sha256-g3cAlVmRtnyqMZw88MKqVNM8eU88XzgNAlXdTkym5q8=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "ab0a3268e04f2295ec4455be90ce8d0c2b107b8d",
|
"rev": "b0a70f63e3865eaa77f0b78a04b230aa583bc95c",
|
||||||
"revCount": 5040,
|
"revCount": 5055,
|
||||||
"submodules": true,
|
"submodules": true,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/hyprwm/Hyprland/"
|
"url": "https://github.com/hyprwm/Hyprland/"
|
||||||
|
@ -361,11 +361,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720709712,
|
"lastModified": 1722636442,
|
||||||
"narHash": "sha256-78j/cY+AXoMIqqiNc1vWx237EPfpERAcYsb57ABUbwQ=",
|
"narHash": "sha256-+7IS0n3/F0I5j6ZbrVlLcIIPHY3o+/vLAqg/G48sG+w=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "contrib",
|
"repo": "contrib",
|
||||||
"rev": "65d42dcbfde2229a75ccdb195c318dfe241f9ade",
|
"rev": "9d67858b437d4a1299be496d371b66fc0d3e01f6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -518,11 +518,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722168631,
|
"lastModified": 1722773431,
|
||||||
"narHash": "sha256-16XBXW86ceQC+jRx7feCREZo696kvIzpKYmN2LnKfaE=",
|
"narHash": "sha256-puSEio9yjWojIBDBts4BSGZ43rv1LzIevdYOKmW/Mjg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lib-aggregate",
|
"repo": "lib-aggregate",
|
||||||
"rev": "4ce8efe904950cd85bda9624ff1c2ec55fe2ab6f",
|
"rev": "04a4b4d84e02590715e753da3d35fb03cddc6425",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -534,11 +534,11 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722529543,
|
"lastModified": 1722957485,
|
||||||
"narHash": "sha256-IDr+fHKwmpaWi4hzD2RYLdiaGEFOrsFm+NeHKETxMhk=",
|
"narHash": "sha256-cEemTAXvhRcjn7XxujIRglqEfAFgdlNulkRSFskowbo=",
|
||||||
"rev": "61a93d53081141d4ab222dcb939dd5caa8ffc767",
|
"rev": "f84997cbefb2f2dd99e48f0ad39f747ed83d69e9",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/61a93d53081141d4ab222dcb939dd5caa8ffc767.tar.gz"
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/f84997cbefb2f2dd99e48f0ad39f747ed83d69e9.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
|
@ -618,11 +618,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722136042,
|
"lastModified": 1722740924,
|
||||||
"narHash": "sha256-x3FmT4QSyK28itMiR5zfYhUrG5nY+2dv+AIcKfmSp5A=",
|
"narHash": "sha256-UQPgA5d8azLZuDHZMPmvDszhuKF1Ek89SrTRtqsQ4Ss=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "c0ca47e8523b578464014961059999d8eddd4aae",
|
"rev": "97ca0a0fca0391de835f57e44f369a283e37890f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -694,11 +694,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722128034,
|
"lastModified": 1722732880,
|
||||||
"narHash": "sha256-L8rwzYPsLo/TYtydPJoQyYOfetuiyQYnTWYcyB8UE/s=",
|
"narHash": "sha256-do2Mfm3T6SR7a5A804RhjQ+JTsF5hk4JTPGjCTRM/m8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "d15f6f6021693898fcd2c6a9bb13707383da9bbc",
|
"rev": "8bebd4c74f368aacb047f0141db09ec6b339733c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -715,11 +715,11 @@
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722530466,
|
"lastModified": 1722928655,
|
||||||
"narHash": "sha256-9YvLtuLAA+LVmfrvlOsynHkS0DRCYnHFEp72NfXFVnc=",
|
"narHash": "sha256-2BAfUaRzrhHwT/JodTq++DUf/nljgoFEc5A79SS8ydU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "0bbe640011f1350933109f5450b15f9bd1fb5e9f",
|
"rev": "423d21c157c2a7b384ae9c766e25759576dceb87",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -762,11 +762,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722415718,
|
"lastModified": 1722926584,
|
||||||
"narHash": "sha256-5US0/pgxbMksF92k1+eOa8arJTJiPvsdZj9Dl+vJkM4=",
|
"narHash": "sha256-sLA+lfCxTkXf4o3JVxcfe+w9kAzauGfEnJ9roNbNng8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c3392ad349a5227f4a3464dce87bcc5046692fce",
|
"rev": "d33cf80b603b3d0cddb48f9816cae707a59e2334",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -794,11 +794,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722421184,
|
"lastModified": 1722813957,
|
||||||
"narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
|
"narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
|
"rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -857,11 +857,11 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722523856,
|
"lastModified": 1722856566,
|
||||||
"narHash": "sha256-hjdIYAuQMWLtlxxj9GpgnfFgmGJhxDDYXnBvEVeNXG8=",
|
"narHash": "sha256-Yr9P/TyxgVVwgXIiu96up2hgWjMR0zWPbaihyNXp+r0=",
|
||||||
"owner": "roc-lang",
|
"owner": "roc-lang",
|
||||||
"repo": "roc",
|
"repo": "roc",
|
||||||
"rev": "790eabd933e13b0836c6ec243c77f873a5956966",
|
"rev": "13f60cde09ef01c003fe362bf46e592a0f4ae7c6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1135,11 +1135,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1721995783,
|
"lastModified": 1722600600,
|
||||||
"narHash": "sha256-GLI+3yaZn6hHvv6wnYJHGqPfX6G3tXJNrTi7qYV9u94=",
|
"narHash": "sha256-bRpvmyAvt4OFbQJlmAURyW1To8nlRjNcQJdbOyI1MLE=",
|
||||||
"owner": "mitchellh",
|
"owner": "mitchellh",
|
||||||
"repo": "zig-overlay",
|
"repo": "zig-overlay",
|
||||||
"rev": "d9099d32bb395be5ed7eeb12ea0145d476632bd1",
|
"rev": "4c95bb8378ca31cc06eba0a9ee0c04851221c193",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1156,11 +1156,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722475688,
|
"lastModified": 1722907357,
|
||||||
"narHash": "sha256-b9q/NoJ3I5LtXVvxxjxNRxDEVMd+1daVldCyAYH7aCU=",
|
"narHash": "sha256-alp8wfWJtxLXKNuVXPjhWFtrGhp10/3Nle//1RkapgU=",
|
||||||
"owner": "Cloudef",
|
"owner": "Cloudef",
|
||||||
"repo": "zig2nix",
|
"repo": "zig2nix",
|
||||||
"rev": "b368a9170c6d6727375d2f43baf2565280e86019",
|
"rev": "32c6285061bbab4920b020ec9e9f4aa5c9a81750",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1180,11 +1180,11 @@
|
||||||
"zig-overlay": "zig-overlay"
|
"zig-overlay": "zig-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1722209386,
|
"lastModified": 1722919037,
|
||||||
"narHash": "sha256-GAzXTJUJJIXrAlHkInSDwlnVQPL5BV1Enbj3R4ipGFk=",
|
"narHash": "sha256-h8BG+XOCli8++tCojSo/cF39AIixVj3mO94b4cuqT94=",
|
||||||
"owner": "zigtools",
|
"owner": "zigtools",
|
||||||
"repo": "zls",
|
"repo": "zls",
|
||||||
"rev": "eba1489b6ffa6db7f0eaefce6e06d53cd9066f7b",
|
"rev": "74b5a00f67ab4e5a848646411779221e6cc24b87",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
49
flake.nix
49
flake.nix
|
@ -8,10 +8,7 @@
|
||||||
stable.url = "github:nixos/nixpkgs/nixos-23.11";
|
stable.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||||
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||||
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
||||||
nix-index-database = {
|
nix-index-database.url = "github:nix-community/nix-index-database";
|
||||||
url = "github:nix-community/nix-index-database";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
lix.url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
lix.url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
||||||
lix.flake = false;
|
lix.flake = false;
|
||||||
|
@ -23,37 +20,23 @@
|
||||||
|
|
||||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland/?submodules=1";
|
hyprland.url = "git+https://github.com/hyprwm/Hyprland/?submodules=1";
|
||||||
hyprland-contrib.url = "github:hyprwm/contrib";
|
hyprland-contrib.url = "github:hyprwm/contrib";
|
||||||
|
roc.url = "github:roc-lang/roc";
|
||||||
|
zig2nix.url = "github:Cloudef/zig2nix";
|
||||||
|
zls.url = "github:zigtools/zls";
|
||||||
|
|
||||||
zig2nix = {
|
pixi.url = "github:daylinmorgan/pixi-flake";
|
||||||
url = "github:Cloudef/zig2nix";
|
f1multiviewer.url = "github:daylinmorgan/f1multiviewer-flake";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
tsm.url = "github:daylinmorgan/tsm?dir=nix";
|
||||||
};
|
hyprman.url = "git+https://git.dayl.in/daylin/hyprman.git";
|
||||||
zls = {
|
|
||||||
url = "github:zigtools/zls";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
roc = {
|
hyprman.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:roc-lang/roc";
|
f1multiviewer.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
pixi.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
roc.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
pixi = {
|
tsm.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
url = "github:daylinmorgan/pixi-flake";
|
zls.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
zig2nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
|
||||||
f1multiviewer = {
|
|
||||||
url = "github:daylinmorgan/f1multiviewer-flake";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
tsm = {
|
|
||||||
url = "github:daylinmorgan/tsm?dir=nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
hyprman = {
|
|
||||||
url = "git+https://git.dayl.in/daylin/hyprman.git";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
|
|
|
@ -14,18 +14,29 @@ in
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
# nix.package = pkgs.nixVersions.latest;
|
# nix.package = pkgs.nixVersions.latest;
|
||||||
nix.extraOptions = ''
|
nix = {
|
||||||
experimental-features = nix-command flakes
|
extraOptions = ''
|
||||||
use-xdg-base-directories = true
|
experimental-features = nix-command flakes
|
||||||
'';
|
use-xdg-base-directories = true
|
||||||
|
'';
|
||||||
|
|
||||||
nix.optimise.automatic = true;
|
optimise.automatic = true;
|
||||||
nix.gc = {
|
gc = {
|
||||||
automatic = true;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 7d";
|
options = "--delete-older-than 7d";
|
||||||
|
};
|
||||||
|
|
||||||
|
# use the same nixpkgs for nix run "nixpkgs#hello" style commands
|
||||||
|
registry.nixpkgs.flake = inputs.nixpkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html#_nix-shell_vs_nix_shell
|
||||||
|
# use the same nixpkgs for nix-shell -p hello style commands
|
||||||
|
# I don't know that this is necesary...
|
||||||
|
# nix.nixPath = [ "nixpkgs=/etc/channels/nixpkgs" ];
|
||||||
|
# environment.etc."channels/nixpkgs".source = inputs.nixpkgs.outPath;
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.nixd
|
pkgs.nixd
|
||||||
pkgs.nixfmt-rfc-style
|
pkgs.nixfmt-rfc-style
|
||||||
|
|
|
@ -41,7 +41,7 @@ in
|
||||||
|
|
||||||
options.oizys = {
|
options.oizys = {
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = lib.types.string;
|
type = lib.types.str;
|
||||||
default = "daylin";
|
default = "daylin";
|
||||||
description = "main user account";
|
description = "main user account";
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,10 +10,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var validArgs = []string{
|
var validArgs = []string{
|
||||||
"switch", "boot", "test", "build", "dry-build", "dry-activate", "edit", "repl",
|
"switch", "boot", "test", "build", "dry-build",
|
||||||
|
"dry-activate", "edit", "repl",
|
||||||
"build-vm", "build-vm-with-bootloader",
|
"build-vm", "build-vm-with-bootloader",
|
||||||
"list-generations",
|
"list-generations",
|
||||||
}
|
}
|
||||||
|
|
||||||
var osCmd = &cobra.Command{
|
var osCmd = &cobra.Command{
|
||||||
Use: "os [subcmd]",
|
Use: "os [subcmd]",
|
||||||
Short: "nixos-rebuild wrapper",
|
Short: "nixos-rebuild wrapper",
|
||||||
|
@ -21,11 +23,14 @@ var osCmd = &cobra.Command{
|
||||||
if err := cobra.MinimumNArgs(1)(cmd, args); err != nil {
|
if err := cobra.MinimumNArgs(1)(cmd, args); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Run the custom validation logic
|
|
||||||
if slices.Contains(validArgs, args[0]) {
|
if slices.Contains(validArgs, args[0]) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return fmt.Errorf("unexpected arg: %s\nexpected one of:\n %s", args[0], strings.Join(validArgs, ", "))
|
return fmt.Errorf(
|
||||||
|
"unexpected arg: %s\nexpected one of:\n %s",
|
||||||
|
args[0],
|
||||||
|
strings.Join(validArgs, ", "),
|
||||||
|
)
|
||||||
},
|
},
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
subcmd := args[0]
|
subcmd := args[0]
|
||||||
|
|
|
@ -32,7 +32,6 @@ var (
|
||||||
flake string
|
flake string
|
||||||
host string
|
host string
|
||||||
debug bool
|
debug bool
|
||||||
verbose bool
|
|
||||||
systemPath bool
|
systemPath bool
|
||||||
resetCache bool
|
resetCache bool
|
||||||
minimal bool
|
minimal bool
|
||||||
|
@ -48,7 +47,6 @@ var rootCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
oizys.SetFlake(flake)
|
oizys.SetFlake(flake)
|
||||||
oizys.SetHost(host)
|
oizys.SetHost(host)
|
||||||
oizys.SetVerbose(verbose)
|
|
||||||
oizys.SetResetCache(resetCache)
|
oizys.SetResetCache(resetCache)
|
||||||
oizys.SetDebug(debug)
|
oizys.SetDebug(debug)
|
||||||
},
|
},
|
||||||
|
@ -76,7 +74,6 @@ func init() {
|
||||||
rootCmd.CompletionOptions.HiddenDefaultCmd = true
|
rootCmd.CompletionOptions.HiddenDefaultCmd = true
|
||||||
rootCmd.PersistentFlags().StringVar(&flake, "flake", "", "path to flake ($OIZYS_DIR or $HOME/oizys)")
|
rootCmd.PersistentFlags().StringVar(&flake, "flake", "", "path to flake ($OIZYS_DIR or $HOME/oizys)")
|
||||||
rootCmd.PersistentFlags().StringVar(&host, "host", "", "host(s) to build (current host)")
|
rootCmd.PersistentFlags().StringVar(&host, "host", "", "host(s) to build (current host)")
|
||||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "show verbose output")
|
|
||||||
rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "show debug output")
|
rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "show debug output")
|
||||||
rootCmd.PersistentFlags().BoolVar(&resetCache, "reset-cache", false, "set narinfo-cache-negative-ttl to 0")
|
rootCmd.PersistentFlags().BoolVar(&resetCache, "reset-cache", false, "set narinfo-cache-negative-ttl to 0")
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ require (
|
||||||
github.com/google/go-github/v63 v63.0.0
|
github.com/google/go-github/v63 v63.0.0
|
||||||
github.com/ivanpirog/coloredcobra v1.0.1
|
github.com/ivanpirog/coloredcobra v1.0.1
|
||||||
github.com/spf13/cobra v1.8.0
|
github.com/spf13/cobra v1.8.0
|
||||||
golang.org/x/term v0.21.0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
@ -28,4 +27,5 @@ require (
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
||||||
golang.org/x/sys v0.21.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
|
golang.org/x/term v0.21.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"oizys/internal/oizys"
|
"oizys/internal/oizys"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/charmbracelet/log"
|
"github.com/charmbracelet/log"
|
||||||
"github.com/google/go-github/v63/github"
|
"github.com/google/go-github/v63/github"
|
||||||
|
@ -154,17 +155,10 @@ func ReadMarkdownFromZip(zipData []byte, fileName string) (string, error) {
|
||||||
return string(content), nil
|
return string(content), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// func CI(rest ...string) {
|
|
||||||
// args := []string{
|
|
||||||
// "workflow", "run", "build.yml",
|
|
||||||
// "-F", fmt.Sprintf("hosts=%s", o.host),
|
|
||||||
// }
|
|
||||||
// args = append(args, rest...)
|
|
||||||
// cmd := exec.Command("gh", args...)
|
|
||||||
// e.ExitWithCommand(cmd)
|
|
||||||
// }
|
|
||||||
|
|
||||||
func CreateDispatch(workflowFileName string, ref string, inputs map[string]interface{}) {
|
func CreateDispatch(workflowFileName string, ref string, inputs map[string]interface{}) {
|
||||||
|
if !strings.HasSuffix(workflowFileName, ".yml") && !strings.HasSuffix(workflowFileName, ".yaml") {
|
||||||
|
workflowFileName = workflowFileName + ".yml"
|
||||||
|
}
|
||||||
log.Infof("creating dispatch event for %s", workflowFileName)
|
log.Infof("creating dispatch event for %s", workflowFileName)
|
||||||
event := github.CreateWorkflowDispatchEventRequest{Ref: ref, Inputs: inputs}
|
event := github.CreateWorkflowDispatchEventRequest{Ref: ref, Inputs: inputs}
|
||||||
_, err := client.Actions.CreateWorkflowDispatchEventByFileName(
|
_, err := client.Actions.CreateWorkflowDispatchEventByFileName(
|
||||||
|
|
|
@ -35,7 +35,6 @@ type Oizys struct {
|
||||||
githubToken string
|
githubToken string
|
||||||
local bool
|
local bool
|
||||||
inCI bool
|
inCI bool
|
||||||
verbose bool
|
|
||||||
systemPath bool
|
systemPath bool
|
||||||
resetCache bool
|
resetCache bool
|
||||||
debug bool
|
debug bool
|
||||||
|
@ -101,9 +100,6 @@ func SetHost(name string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetHost() string { return o.host }
|
func GetHost() string { return o.host }
|
||||||
func SetVerbose(v bool) {
|
|
||||||
o.verbose = v
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetResetCache(reset bool) {
|
func SetResetCache(reset bool) {
|
||||||
o.resetCache = reset
|
o.resetCache = reset
|
||||||
|
@ -241,7 +237,7 @@ func NixosRebuild(subcmd string, rest ...string) {
|
||||||
if !o.inCI {
|
if !o.inCI {
|
||||||
cmd.Args = append(cmd.Args, "--log-format", "multiline")
|
cmd.Args = append(cmd.Args, "--log-format", "multiline")
|
||||||
}
|
}
|
||||||
if o.verbose {
|
if o.debug {
|
||||||
cmd.Args = append(cmd.Args, "--print-build-logs")
|
cmd.Args = append(cmd.Args, "--print-build-logs")
|
||||||
}
|
}
|
||||||
cmd.Args = append(cmd.Args, rest...)
|
cmd.Args = append(cmd.Args, rest...)
|
||||||
|
|
Loading…
Reference in a new issue