mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-30 16:10:44 -06:00
Compare commits
No commits in common. "7b6cdedcd14acd86d0ac0d977ce36c73ce8cf973" and "ef3153ffc1974dad850395d472e2bef224516da3" have entirely different histories.
7b6cdedcd1
...
ef3153ffc1
12 changed files with 106 additions and 105 deletions
125
flake.lock
125
flake.lock
|
@ -193,26 +193,27 @@
|
||||||
"hyprland": {
|
"hyprland": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprcursor": "hyprcursor",
|
"hyprcursor": "hyprcursor",
|
||||||
|
"hyprland-protocols": "hyprland-protocols",
|
||||||
"hyprlang": "hyprlang",
|
"hyprlang": "hyprlang",
|
||||||
"hyprwayland-scanner": "hyprwayland-scanner",
|
"hyprwayland-scanner": "hyprwayland-scanner",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"systems": "systems",
|
"systems": "systems",
|
||||||
|
"wlroots": "wlroots",
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714933694,
|
"lastModified": 1714568252,
|
||||||
"narHash": "sha256-gziEBZF1wmBBw3v0Ang3nN3QwoQWtFmBIORODJt38TE=",
|
"narHash": "sha256-sPHpRfM+D5P4ZuADRSCiAhhk1/ZQHHX0SYUIoD2l4DQ=",
|
||||||
"ref": "refs/heads/main",
|
"owner": "hyprwm",
|
||||||
"rev": "cddeec47a1fc0e70d8598fd10c29cd0e9489999f",
|
"repo": "Hyprland",
|
||||||
"revCount": 4617,
|
"rev": "4ed6b69b68a544a81cec583a1ad8aff218f7db5d",
|
||||||
"submodules": true,
|
"type": "github"
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/hyprwm/Hyprland"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"submodules": true,
|
"owner": "hyprwm",
|
||||||
"type": "git",
|
"ref": "main",
|
||||||
"url": "https://github.com/hyprwm/Hyprland"
|
"repo": "Hyprland",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hyprland-contrib": {
|
"hyprland-contrib": {
|
||||||
|
@ -237,21 +238,19 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
"xdph",
|
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"systems": [
|
"systems": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
"xdph",
|
|
||||||
"systems"
|
"systems"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714869498,
|
"lastModified": 1691753796,
|
||||||
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=",
|
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprland-protocols",
|
"repo": "hyprland-protocols",
|
||||||
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161",
|
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -297,11 +296,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714755542,
|
"lastModified": 1714171579,
|
||||||
"narHash": "sha256-D0pg+ZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY=",
|
"narHash": "sha256-eaWDIvt8ufUKKz3Lc2a3PyemLJG1m9RYlF+HP3hWbaw=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprwayland-scanner",
|
"repo": "hyprwayland-scanner",
|
||||||
"rev": "1270ebaa539e56d61b708c24b072b09cbbd3a828",
|
"rev": "126dad854f22fe30e6b82cd21808e76903d90ac5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -328,11 +327,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714910950,
|
"lastModified": 1714306226,
|
||||||
"narHash": "sha256-gaq5bphSsY+htEXFDkImOrH3MVCkxFTvCiwdCJj096E=",
|
"narHash": "sha256-CA7bfnDt9TcFc7I8eKHf72DodYUEETDPgmBFXBRP9/E=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lib-aggregate",
|
"repo": "lib-aggregate",
|
||||||
"rev": "26fabca301e1133abd3d9192b1bcb6fb45b30f1d",
|
"rev": "49d9b510614b9bd137e067eb31445a8feca83313",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -391,11 +390,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714878592,
|
"lastModified": 1714273701,
|
||||||
"narHash": "sha256-E68C03sYRsYFsK7wiGHUIJm8IsyPRALOrFoTL0glXnI=",
|
"narHash": "sha256-bmoeZ5zMSSO/e8P51yjrzaxA9uzA3SZAEFvih6S3LFo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "a362555e9dbd4ecff3bb98969bbdb8f79fe87f10",
|
"rev": "941c4973c824509e0356be455d89613611f76c8a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -422,11 +421,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714870069,
|
"lastModified": 1714265296,
|
||||||
"narHash": "sha256-CNCqCGOHdxuiVnVkhTpp2WcqSSmSfeQjubhDOcgwGjU=",
|
"narHash": "sha256-jVnKiCOoFulPT1zDdA4jfG/lnEnngdth5CT6rVDXEJ4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "4b620020fd73bdd5104e32c702e65b60b6869426",
|
"rev": "ade4fb7bbf04cd52bc1705734d5dc67755d77ec9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -443,11 +442,11 @@
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714926024,
|
"lastModified": 1714525911,
|
||||||
"narHash": "sha256-LbSVziNYk/nxfYeyxKNhV/ryfbCUUZVlWoG5KG0sOxk=",
|
"narHash": "sha256-XYARtyCpKeL0IosMSzeHl6YFblV3n4y7plM+K9fg4N4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "eb44cc5dcc75c33e7f246c9f38b96f158b3f6e9d",
|
"rev": "4cbf82124f2c03fa5b1b669771c48f9927264684",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -458,11 +457,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714253743,
|
"lastModified": 1713714899,
|
||||||
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
|
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
|
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -490,11 +489,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714809261,
|
"lastModified": 1714656196,
|
||||||
"narHash": "sha256-hfBmnYFyz9I1mdrC3tX1A+dF9cOUcds5PIMPxrT+cRk=",
|
"narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d32560238207b8e26d88b265207b216ee46b8450",
|
"rev": "94035b482d181af0a0f8f77823a790b256b7c3cc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -522,11 +521,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714763106,
|
"lastModified": 1714253743,
|
||||||
"narHash": "sha256-DrDHo74uTycfpAF+/qxZAMlP/Cpe04BVioJb6fdI0YY=",
|
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e9be42459999a253a9f92559b1f5b72e1b44c13d",
|
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -573,11 +572,11 @@
|
||||||
},
|
},
|
||||||
"stable": {
|
"stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714782413,
|
"lastModified": 1714409183,
|
||||||
"narHash": "sha256-tbg0MEuKaPcUrnmGCu4xiY5F+7LW2+ECPKVAJd2HLwM=",
|
"narHash": "sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH+RU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "651b4702e27a388f0f18e1b970534162dec09aff",
|
"rev": "576ecd43d3b864966b4423a853412d6177775e8b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -691,9 +690,29 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"wlroots": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1713731601,
|
||||||
|
"narHash": "sha256-bdcKdtLkusvv85DNuJsajZLFeq7bXp+x5AGP1Sd4wD8=",
|
||||||
|
"owner": "hyprwm",
|
||||||
|
"repo": "wlroots-hyprland",
|
||||||
|
"rev": "5c1d51c5a2793480f5b6c4341ad0797052aec2ea",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hyprwm",
|
||||||
|
"repo": "wlroots-hyprland",
|
||||||
|
"rev": "5c1d51c5a2793480f5b6c4341ad0797052aec2ea",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xdph": {
|
"xdph": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprland-protocols": "hyprland-protocols",
|
"hyprland-protocols": [
|
||||||
|
"hyprland",
|
||||||
|
"hyprland-protocols"
|
||||||
|
],
|
||||||
"hyprlang": [
|
"hyprlang": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
"hyprlang"
|
"hyprlang"
|
||||||
|
@ -708,11 +727,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714060055,
|
"lastModified": 1713724432,
|
||||||
"narHash": "sha256-j43TS9wv9luaAlpxcxw0sjxkbcc2mGANVR2RYgo3RCw=",
|
"narHash": "sha256-dtU1y4oj/0Y42oauzm93ucFg1AoqETnQ21bmXTIUng0=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "xdg-desktop-portal-hyprland",
|
"repo": "xdg-desktop-portal-hyprland",
|
||||||
"rev": "0fe840441e43da12cd7865ed9aa8cdc35a8da85a",
|
"rev": "9ace6f969ce495185df34cc6254fb9d297765478",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -752,11 +771,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714871906,
|
"lastModified": 1714526316,
|
||||||
"narHash": "sha256-HDtmvjUjWVq+EIvem2rwRrGhR13KYqCQKq5xSm3mP+8=",
|
"narHash": "sha256-Gv8hKB0JKQn3xFekNcu1Mz/UgTkqS9ypSXVrUZ0NTrs=",
|
||||||
"owner": "Cloudef",
|
"owner": "Cloudef",
|
||||||
"repo": "zig2nix",
|
"repo": "zig2nix",
|
||||||
"rev": "deb76120bc98822cfa66c33778562214479eb050",
|
"rev": "825245d8809e086f9207f77f1e7a5c1fd7799c7e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -776,11 +795,11 @@
|
||||||
"zig-overlay": "zig-overlay"
|
"zig-overlay": "zig-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714726694,
|
"lastModified": 1714570733,
|
||||||
"narHash": "sha256-EZpShJM2csFe+EBFJyjVWs6/nPvQwiMuuWsmeltEMXg=",
|
"narHash": "sha256-3Cy6f3py/Errlie6osdYmmTPJWOgGLl5cuySXgjO/0w=",
|
||||||
"owner": "zigtools",
|
"owner": "zigtools",
|
||||||
"repo": "zls",
|
"repo": "zls",
|
||||||
"rev": "f6817ed3ca4d70c2181f96fbbf84cb533cd7205e",
|
"rev": "75bd32d1be6decda507aad9eb224803d2e8ae70d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
tsm.url = "github:daylinmorgan/tsm?dir=nix";
|
tsm.url = "github:daylinmorgan/tsm?dir=nix";
|
||||||
tsm.inputs.nixpkgs.follows = "nixpkgs";
|
tsm.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
# hyprland.url = "github:hyprwm/Hyprland/main";
|
hyprland.url = "github:hyprwm/Hyprland/main";
|
||||||
# https://github.com/hyprwm/Hyprland/issues/5891
|
|
||||||
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
|
|
||||||
hyprland-contrib.url = "github:hyprwm/contrib";
|
hyprland-contrib.url = "github:hyprwm/contrib";
|
||||||
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,7 @@ mkOizysModule config "hyprland" {
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
inputs.hyprland-contrib.overlays.default
|
inputs.hyprland-contrib.overlays.default
|
||||||
# some issue with dunst?
|
inputs.nixpkgs-wayland.overlay
|
||||||
# inputs.nixpkgs-wayland.overlay
|
|
||||||
|
|
||||||
# when this was active I was forced to recompile VirtualBox myself, which would just fail to compile...
|
# when this was active I was forced to recompile VirtualBox myself, which would just fail to compile...
|
||||||
# Must have been one of the other non-hyprland packages modified in the overlay
|
# Must have been one of the other non-hyprland packages modified in the overlay
|
||||||
# inputs.hyprland.overlays.default
|
# inputs.hyprland.overlays.default
|
||||||
|
|
|
@ -5,15 +5,16 @@ import (
|
||||||
"oizys/pkg/oizys"
|
"oizys/pkg/oizys"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var bootCmd = &cobra.Command{
|
var bootCmd = &cobra.Command{
|
||||||
Use: "boot",
|
Use: "boot",
|
||||||
Short: "nixos rebuild boot",
|
Short: "nixos rebuild boot",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oizys.CheckFlake(flake)
|
|
||||||
oizys.NixosRebuild("boot", flake)
|
oizys.NixosRebuild("boot", flake)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(bootCmd)
|
rootCmd.AddCommand(bootCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,17 @@ import (
|
||||||
"oizys/pkg/oizys"
|
"oizys/pkg/oizys"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
var buildCmd = &cobra.Command{
|
var buildCmd = &cobra.Command{
|
||||||
Use: "build",
|
Use: "build",
|
||||||
Short: "A brief description of your command",
|
Short: "A brief description of your command",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oizys.CheckFlake(flake)
|
|
||||||
oizys.NixBuild(oizys.Output(flake, host), args...)
|
oizys.NixBuild(oizys.Output(flake, host), args...)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(buildCmd)
|
rootCmd.AddCommand(buildCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ var cacheCmd = &cobra.Command{
|
||||||
Use: "cache",
|
Use: "cache",
|
||||||
Short: "build and push to cachix",
|
Short: "build and push to cachix",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oizys.CheckFlake(flake)
|
|
||||||
oizys.CacheBuild(oizys.Output(flake, host), cacheName, args...)
|
oizys.CacheBuild(oizys.Output(flake, host), cacheName, args...)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -17,10 +16,10 @@ var cacheCmd = &cobra.Command{
|
||||||
func init() {
|
func init() {
|
||||||
cacheCmd.Flags().StringVarP(
|
cacheCmd.Flags().StringVarP(
|
||||||
&cacheName,
|
&cacheName,
|
||||||
"cache",
|
"cache",
|
||||||
"c",
|
"c",
|
||||||
"daylin",
|
"daylin",
|
||||||
"name of cachix binary cache",
|
"name of cachix binary cache",
|
||||||
)
|
)
|
||||||
rootCmd.AddCommand(cacheCmd)
|
rootCmd.AddCommand(cacheCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"oizys/pkg/oizys"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"oizys/pkg/oizys"
|
||||||
)
|
)
|
||||||
|
|
||||||
var dryCmd = &cobra.Command{
|
var dryCmd = &cobra.Command{
|
||||||
Use: "dry",
|
Use: "dry",
|
||||||
Short: "poor man's nix flake check",
|
Short: "poor man's nix flake check",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oizys.CheckFlake(flake)
|
|
||||||
oizys.NixDryRun(oizys.Output(flake, host))
|
oizys.NixDryRun(oizys.Output(flake, host))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(dryCmd)
|
rootCmd.AddCommand(dryCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,15 +7,15 @@ import (
|
||||||
"oizys/pkg/oizys"
|
"oizys/pkg/oizys"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
var outputCmd = &cobra.Command{
|
var outputCmd = &cobra.Command{
|
||||||
Use: "output",
|
Use: "output",
|
||||||
Short: "show nixosConfiguration attr",
|
Short: "show nixosConfiguration attr",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oizys.CheckFlake(flake)
|
|
||||||
fmt.Println(oizys.Output(flake, host))
|
fmt.Println(oizys.Output(flake, host))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(outputCmd)
|
rootCmd.AddCommand(outputCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
@ -19,6 +21,10 @@ func setFlake() {
|
||||||
flake = oizysDir
|
flake = oizysDir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat(flake); errors.Is(err, fs.ErrNotExist) {
|
||||||
|
log.Fatalln("path to flake:", flake, "does not exist")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setHost() {
|
func setHost() {
|
||||||
|
@ -63,6 +69,7 @@ var rootCmd = &cobra.Command{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func init() {
|
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)")
|
||||||
|
|
|
@ -9,11 +9,11 @@ var switchCmd = &cobra.Command{
|
||||||
Use: "switch",
|
Use: "switch",
|
||||||
Short: "nixos rebuild switch",
|
Short: "nixos rebuild switch",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oizys.CheckFlake(flake)
|
|
||||||
oizys.NixosRebuild("switch", flake, args...)
|
oizys.NixosRebuild("switch", flake, args...)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(switchCmd)
|
rootCmd.AddCommand(switchCmd)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
installShellFiles,
|
|
||||||
buildGoModule,
|
buildGoModule,
|
||||||
lib,
|
lib,
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
pname = "oizys";
|
pname = "oizys";
|
||||||
|
@ -11,11 +8,4 @@ buildGoModule {
|
||||||
|
|
||||||
src = lib.cleanSource ./.;
|
src = lib.cleanSource ./.;
|
||||||
vendorHash = "sha256-kh/7dV49KaQcD9ho8IpBcRc6+05bn4XpMzAI9JXu7+o=";
|
vendorHash = "sha256-kh/7dV49KaQcD9ho8IpBcRc6+05bn4XpMzAI9JXu7+o=";
|
||||||
|
|
||||||
nativeBuildInputs = [installShellFiles];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
installShellCompletion --cmd oizys \
|
|
||||||
--zsh <($out/bin/oizys completion zsh)
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package oizys
|
package oizys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -29,10 +27,10 @@ func TerminalSize() (int, int) {
|
||||||
func ParseDryRunOutput(nixOutput string) {
|
func ParseDryRunOutput(nixOutput string) {
|
||||||
output := termenv.NewOutput(os.Stdout)
|
output := termenv.NewOutput(os.Stdout)
|
||||||
parts := strings.Split(nixOutput, "\nthese")
|
parts := strings.Split(nixOutput, "\nthese")
|
||||||
if len(parts) != 3 {
|
if len(parts) != 3 {
|
||||||
log.Println("no changes...")
|
log.Println("no changes...")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
built := strings.Split(strings.TrimSpace(parts[1]), "\n")[1:]
|
built := strings.Split(strings.TrimSpace(parts[1]), "\n")[1:]
|
||||||
fetched := strings.Split(strings.TrimSpace(parts[2]), "\n")[1:]
|
fetched := strings.Split(strings.TrimSpace(parts[2]), "\n")[1:]
|
||||||
|
|
||||||
|
@ -73,14 +71,9 @@ func NixDryRun(path string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NixosRebuild(subcmd string, flake string, rest ...string) {
|
func NixosRebuild(subcmd string, flake string, rest ...string) {
|
||||||
args := []string{
|
args := []string{subcmd, "--flake"}
|
||||||
"nixos-rebuild",
|
|
||||||
subcmd,
|
|
||||||
"--flake",
|
|
||||||
flake,
|
|
||||||
}
|
|
||||||
args = append(args, rest...)
|
args = append(args, rest...)
|
||||||
cmd := exec.Command("sudo", args...)
|
cmd := exec.Command("nixos-rebuild", args...)
|
||||||
runCommand(cmd)
|
runCommand(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +88,7 @@ func runCommand(cmd *exec.Cmd) {
|
||||||
func NixBuild(path string, rest ...string) {
|
func NixBuild(path string, rest ...string) {
|
||||||
args := []string{"build", path}
|
args := []string{"build", path}
|
||||||
args = append(args, rest...)
|
args = append(args, rest...)
|
||||||
|
fmt.Println(args)
|
||||||
cmd := exec.Command("nix", args...)
|
cmd := exec.Command("nix", args...)
|
||||||
runCommand(cmd)
|
runCommand(cmd)
|
||||||
}
|
}
|
||||||
|
@ -110,12 +104,6 @@ func CacheBuild(path string, cache string, rest ...string) {
|
||||||
runCommand(cmd)
|
runCommand(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckFlake(flake string) {
|
|
||||||
if _, err := os.Stat(flake); errors.Is(err, fs.ErrNotExist) {
|
|
||||||
log.Fatalln("path to flake:", flake, "does not exist")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func Output(flake string, host string) string {
|
func Output(flake string, host string) string {
|
||||||
return fmt.Sprintf(
|
return fmt.Sprintf(
|
||||||
"%s#nixosConfigurations.%s.config.system.build.toplevel",
|
"%s#nixosConfigurations.%s.config.system.build.toplevel",
|
||||||
|
|
Loading…
Reference in a new issue