mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-27 14:10:45 -06:00
Compare commits
6 commits
ef3153ffc1
...
7b6cdedcd1
Author | SHA1 | Date | |
---|---|---|---|
7b6cdedcd1 | |||
41cfd7b141 | |||
e68109a40f | |||
0fa0a22f75 | |||
8ab0c10ae1 | |||
f100dd6853 |
12 changed files with 105 additions and 106 deletions
125
flake.lock
125
flake.lock
|
@ -193,27 +193,26 @@
|
||||||
"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": 1714568252,
|
"lastModified": 1714933694,
|
||||||
"narHash": "sha256-sPHpRfM+D5P4ZuADRSCiAhhk1/ZQHHX0SYUIoD2l4DQ=",
|
"narHash": "sha256-gziEBZF1wmBBw3v0Ang3nN3QwoQWtFmBIORODJt38TE=",
|
||||||
"owner": "hyprwm",
|
"ref": "refs/heads/main",
|
||||||
"repo": "Hyprland",
|
"rev": "cddeec47a1fc0e70d8598fd10c29cd0e9489999f",
|
||||||
"rev": "4ed6b69b68a544a81cec583a1ad8aff218f7db5d",
|
"revCount": 4617,
|
||||||
"type": "github"
|
"submodules": true,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/hyprwm/Hyprland"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "hyprwm",
|
"submodules": true,
|
||||||
"ref": "main",
|
"type": "git",
|
||||||
"repo": "Hyprland",
|
"url": "https://github.com/hyprwm/Hyprland"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hyprland-contrib": {
|
"hyprland-contrib": {
|
||||||
|
@ -238,19 +237,21 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
|
"xdph",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"systems": [
|
"systems": [
|
||||||
"hyprland",
|
"hyprland",
|
||||||
|
"xdph",
|
||||||
"systems"
|
"systems"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691753796,
|
"lastModified": 1714869498,
|
||||||
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
|
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprland-protocols",
|
"repo": "hyprland-protocols",
|
||||||
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
|
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -296,11 +297,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714171579,
|
"lastModified": 1714755542,
|
||||||
"narHash": "sha256-eaWDIvt8ufUKKz3Lc2a3PyemLJG1m9RYlF+HP3hWbaw=",
|
"narHash": "sha256-D0pg+ZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprwayland-scanner",
|
"repo": "hyprwayland-scanner",
|
||||||
"rev": "126dad854f22fe30e6b82cd21808e76903d90ac5",
|
"rev": "1270ebaa539e56d61b708c24b072b09cbbd3a828",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -327,11 +328,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714306226,
|
"lastModified": 1714910950,
|
||||||
"narHash": "sha256-CA7bfnDt9TcFc7I8eKHf72DodYUEETDPgmBFXBRP9/E=",
|
"narHash": "sha256-gaq5bphSsY+htEXFDkImOrH3MVCkxFTvCiwdCJj096E=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lib-aggregate",
|
"repo": "lib-aggregate",
|
||||||
"rev": "49d9b510614b9bd137e067eb31445a8feca83313",
|
"rev": "26fabca301e1133abd3d9192b1bcb6fb45b30f1d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -390,11 +391,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714273701,
|
"lastModified": 1714878592,
|
||||||
"narHash": "sha256-bmoeZ5zMSSO/e8P51yjrzaxA9uzA3SZAEFvih6S3LFo=",
|
"narHash": "sha256-E68C03sYRsYFsK7wiGHUIJm8IsyPRALOrFoTL0glXnI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "941c4973c824509e0356be455d89613611f76c8a",
|
"rev": "a362555e9dbd4ecff3bb98969bbdb8f79fe87f10",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -421,11 +422,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714265296,
|
"lastModified": 1714870069,
|
||||||
"narHash": "sha256-jVnKiCOoFulPT1zDdA4jfG/lnEnngdth5CT6rVDXEJ4=",
|
"narHash": "sha256-CNCqCGOHdxuiVnVkhTpp2WcqSSmSfeQjubhDOcgwGjU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "ade4fb7bbf04cd52bc1705734d5dc67755d77ec9",
|
"rev": "4b620020fd73bdd5104e32c702e65b60b6869426",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -442,11 +443,11 @@
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_6"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714525911,
|
"lastModified": 1714926024,
|
||||||
"narHash": "sha256-XYARtyCpKeL0IosMSzeHl6YFblV3n4y7plM+K9fg4N4=",
|
"narHash": "sha256-LbSVziNYk/nxfYeyxKNhV/ryfbCUUZVlWoG5KG0sOxk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "4cbf82124f2c03fa5b1b669771c48f9927264684",
|
"rev": "eb44cc5dcc75c33e7f246c9f38b96f158b3f6e9d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -457,11 +458,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713714899,
|
"lastModified": 1714253743,
|
||||||
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
|
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
|
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -489,11 +490,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714656196,
|
"lastModified": 1714809261,
|
||||||
"narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=",
|
"narHash": "sha256-hfBmnYFyz9I1mdrC3tX1A+dF9cOUcds5PIMPxrT+cRk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "94035b482d181af0a0f8f77823a790b256b7c3cc",
|
"rev": "d32560238207b8e26d88b265207b216ee46b8450",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -521,11 +522,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714253743,
|
"lastModified": 1714763106,
|
||||||
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
|
"narHash": "sha256-DrDHo74uTycfpAF+/qxZAMlP/Cpe04BVioJb6fdI0YY=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
|
"rev": "e9be42459999a253a9f92559b1f5b72e1b44c13d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -572,11 +573,11 @@
|
||||||
},
|
},
|
||||||
"stable": {
|
"stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714409183,
|
"lastModified": 1714782413,
|
||||||
"narHash": "sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH+RU=",
|
"narHash": "sha256-tbg0MEuKaPcUrnmGCu4xiY5F+7LW2+ECPKVAJd2HLwM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "576ecd43d3b864966b4423a853412d6177775e8b",
|
"rev": "651b4702e27a388f0f18e1b970534162dec09aff",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -690,29 +691,9 @@
|
||||||
"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"
|
||||||
|
@ -727,11 +708,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713724432,
|
"lastModified": 1714060055,
|
||||||
"narHash": "sha256-dtU1y4oj/0Y42oauzm93ucFg1AoqETnQ21bmXTIUng0=",
|
"narHash": "sha256-j43TS9wv9luaAlpxcxw0sjxkbcc2mGANVR2RYgo3RCw=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "xdg-desktop-portal-hyprland",
|
"repo": "xdg-desktop-portal-hyprland",
|
||||||
"rev": "9ace6f969ce495185df34cc6254fb9d297765478",
|
"rev": "0fe840441e43da12cd7865ed9aa8cdc35a8da85a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -771,11 +752,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714526316,
|
"lastModified": 1714871906,
|
||||||
"narHash": "sha256-Gv8hKB0JKQn3xFekNcu1Mz/UgTkqS9ypSXVrUZ0NTrs=",
|
"narHash": "sha256-HDtmvjUjWVq+EIvem2rwRrGhR13KYqCQKq5xSm3mP+8=",
|
||||||
"owner": "Cloudef",
|
"owner": "Cloudef",
|
||||||
"repo": "zig2nix",
|
"repo": "zig2nix",
|
||||||
"rev": "825245d8809e086f9207f77f1e7a5c1fd7799c7e",
|
"rev": "deb76120bc98822cfa66c33778562214479eb050",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -795,11 +776,11 @@
|
||||||
"zig-overlay": "zig-overlay"
|
"zig-overlay": "zig-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714570733,
|
"lastModified": 1714726694,
|
||||||
"narHash": "sha256-3Cy6f3py/Errlie6osdYmmTPJWOgGLl5cuySXgjO/0w=",
|
"narHash": "sha256-EZpShJM2csFe+EBFJyjVWs6/nPvQwiMuuWsmeltEMXg=",
|
||||||
"owner": "zigtools",
|
"owner": "zigtools",
|
||||||
"repo": "zls",
|
"repo": "zls",
|
||||||
"rev": "75bd32d1be6decda507aad9eb224803d2e8ae70d",
|
"rev": "f6817ed3ca4d70c2181f96fbbf84cb533cd7205e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
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,7 +54,9 @@ mkOizysModule config "hyprland" {
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
inputs.hyprland-contrib.overlays.default
|
inputs.hyprland-contrib.overlays.default
|
||||||
inputs.nixpkgs-wayland.overlay
|
# some issue with dunst?
|
||||||
|
# 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,16 +5,15 @@ 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,17 +5,15 @@ 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,6 +9,7 @@ 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...)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -16,10 +17,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,19 +1,20 @@
|
||||||
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,9 +1,7 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
@ -21,10 +19,6 @@ 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() {
|
||||||
|
@ -69,7 +63,6 @@ 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,6 +1,9 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
|
installShellFiles,
|
||||||
buildGoModule,
|
buildGoModule,
|
||||||
lib,
|
lib,
|
||||||
|
...
|
||||||
}:
|
}:
|
||||||
buildGoModule {
|
buildGoModule {
|
||||||
pname = "oizys";
|
pname = "oizys";
|
||||||
|
@ -8,4 +11,11 @@ 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,7 +1,9 @@
|
||||||
package oizys
|
package oizys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
@ -27,10 +29,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:]
|
||||||
|
|
||||||
|
@ -71,9 +73,14 @@ func NixDryRun(path string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NixosRebuild(subcmd string, flake string, rest ...string) {
|
func NixosRebuild(subcmd string, flake string, rest ...string) {
|
||||||
args := []string{subcmd, "--flake"}
|
args := []string{
|
||||||
|
"nixos-rebuild",
|
||||||
|
subcmd,
|
||||||
|
"--flake",
|
||||||
|
flake,
|
||||||
|
}
|
||||||
args = append(args, rest...)
|
args = append(args, rest...)
|
||||||
cmd := exec.Command("nixos-rebuild", args...)
|
cmd := exec.Command("sudo", args...)
|
||||||
runCommand(cmd)
|
runCommand(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +95,6 @@ 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)
|
||||||
}
|
}
|
||||||
|
@ -104,6 +110,12 @@ 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