Compare commits

...

6 Commits

Author SHA1 Message Date
Daylin Morgan 7b6cdedcd1
various fixs to oizys-go 2024-05-05 17:10:01 -05:00
Daylin Morgan 41cfd7b141
cleanup 2024-05-05 16:13:24 -05:00
Daylin Morgan e68109a40f
dunst install phase broken 2024-05-05 16:04:06 -05:00
Daylin Morgan 0fa0a22f75
hyprwm uses submodules now rip c++ 2024-05-05 16:03:54 -05:00
Daylin Morgan 8ab0c10ae1
actually pass "flake" to nixos-rebuild 2024-05-05 15:03:35 -05:00
Daylin Morgan f100dd6853
flake.lock: Update
Flake lock file updates:

• Updated input 'hyprland':
    'github:hyprwm/Hyprland/4ed6b69b68a544a81cec583a1ad8aff218f7db5d?narHash=sha256-sPHpRfM%2BD5P4ZuADRSCiAhhk1/ZQHHX0SYUIoD2l4DQ%3D' (2024-05-01)
  → 'github:hyprwm/Hyprland/cddeec47a1fc0e70d8598fd10c29cd0e9489999f?narHash=sha256-sua/1gAfZ2lz3kxFyH6Hg/xu1eTkXOORlhXa21PaLJc%3D' (2024-05-05)
• Removed input 'hyprland/hyprland-protocols'
• Removed input 'hyprland/hyprland-protocols/nixpkgs'
• Removed input 'hyprland/hyprland-protocols/systems'
• Updated input 'hyprland/hyprwayland-scanner':
    'github:hyprwm/hyprwayland-scanner/126dad854f22fe30e6b82cd21808e76903d90ac5?narHash=sha256-eaWDIvt8ufUKKz3Lc2a3PyemLJG1m9RYlF%2BHP3hWbaw%3D' (2024-04-26)
  → 'github:hyprwm/hyprwayland-scanner/1270ebaa539e56d61b708c24b072b09cbbd3a828?narHash=sha256-D0pg%2BZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY%3D' (2024-05-03)
• Updated input 'hyprland/nixpkgs':
    'github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932?narHash=sha256-%2Bz/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y%3D' (2024-04-21)
  → 'github:NixOS/nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994?narHash=sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc%3D' (2024-04-27)
• Removed input 'hyprland/wlroots'
• Updated input 'hyprland/xdph':
    'github:hyprwm/xdg-desktop-portal-hyprland/9ace6f969ce495185df34cc6254fb9d297765478?narHash=sha256-dtU1y4oj/0Y42oauzm93ucFg1AoqETnQ21bmXTIUng0%3D' (2024-04-21)
  → 'github:hyprwm/xdg-desktop-portal-hyprland/0fe840441e43da12cd7865ed9aa8cdc35a8da85a?narHash=sha256-j43TS9wv9luaAlpxcxw0sjxkbcc2mGANVR2RYgo3RCw%3D' (2024-04-25)
• Updated input 'hyprland/xdph/hyprland-protocols':
    follows 'hyprland/hyprland-protocols'
  → 'github:hyprwm/hyprland-protocols/e06482e0e611130cd1929f75e8c1cf679e57d161?narHash=sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM%3D' (2024-05-05)
• Added input 'hyprland/xdph/hyprland-protocols/nixpkgs':
    follows 'hyprland/xdph/nixpkgs'
• Added input 'hyprland/xdph/hyprland-protocols/systems':
    follows 'hyprland/xdph/systems'
• Updated input 'nix-index-database':
    'github:nix-community/nix-index-database/941c4973c824509e0356be455d89613611f76c8a?narHash=sha256-bmoeZ5zMSSO/e8P51yjrzaxA9uzA3SZAEFvih6S3LFo%3D' (2024-04-28)
  → 'github:nix-community/nix-index-database/a362555e9dbd4ecff3bb98969bbdb8f79fe87f10?narHash=sha256-E68C03sYRsYFsK7wiGHUIJm8IsyPRALOrFoTL0glXnI%3D' (2024-05-05)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/94035b482d181af0a0f8f77823a790b256b7c3cc?narHash=sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo%2B2nruiTcTZp5jK7o%3D' (2024-05-02)
  → 'github:nixos/nixpkgs/d32560238207b8e26d88b265207b216ee46b8450?narHash=sha256-hfBmnYFyz9I1mdrC3tX1A%2BdF9cOUcds5PIMPxrT%2BcRk%3D' (2024-05-04)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/4cbf82124f2c03fa5b1b669771c48f9927264684?narHash=sha256-XYARtyCpKeL0IosMSzeHl6YFblV3n4y7plM%2BK9fg4N4%3D' (2024-05-01)
  → 'github:nix-community/nixpkgs-wayland/eb44cc5dcc75c33e7f246c9f38b96f158b3f6e9d?narHash=sha256-LbSVziNYk/nxfYeyxKNhV/ryfbCUUZVlWoG5KG0sOxk%3D' (2024-05-05)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/49d9b510614b9bd137e067eb31445a8feca83313?narHash=sha256-CA7bfnDt9TcFc7I8eKHf72DodYUEETDPgmBFXBRP9/E%3D' (2024-04-28)
  → 'github:nix-community/lib-aggregate/26fabca301e1133abd3d9192b1bcb6fb45b30f1d?narHash=sha256-gaq5bphSsY%2BhtEXFDkImOrH3MVCkxFTvCiwdCJj096E%3D' (2024-05-05)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/ade4fb7bbf04cd52bc1705734d5dc67755d77ec9?narHash=sha256-jVnKiCOoFulPT1zDdA4jfG/lnEnngdth5CT6rVDXEJ4%3D' (2024-04-28)
  → 'github:nix-community/nixpkgs.lib/4b620020fd73bdd5104e32c702e65b60b6869426?narHash=sha256-CNCqCGOHdxuiVnVkhTpp2WcqSSmSfeQjubhDOcgwGjU%3D' (2024-05-05)
• Updated input 'nixpkgs-wayland/nixpkgs':
    'github:nixos/nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994?narHash=sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc%3D' (2024-04-27)
  → 'github:nixos/nixpkgs/e9be42459999a253a9f92559b1f5b72e1b44c13d?narHash=sha256-DrDHo74uTycfpAF%2B/qxZAMlP/Cpe04BVioJb6fdI0YY%3D' (2024-05-03)
• Updated input 'stable':
    'github:nixos/nixpkgs/576ecd43d3b864966b4423a853412d6177775e8b?narHash=sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH%2BRU%3D' (2024-04-29)
  → 'github:nixos/nixpkgs/651b4702e27a388f0f18e1b970534162dec09aff?narHash=sha256-tbg0MEuKaPcUrnmGCu4xiY5F%2B7LW2%2BECPKVAJd2HLwM%3D' (2024-05-04)
• Updated input 'zig2nix':
    'github:Cloudef/zig2nix/825245d8809e086f9207f77f1e7a5c1fd7799c7e?narHash=sha256-Gv8hKB0JKQn3xFekNcu1Mz/UgTkqS9ypSXVrUZ0NTrs%3D' (2024-05-01)
  → 'github:Cloudef/zig2nix/deb76120bc98822cfa66c33778562214479eb050?narHash=sha256-HDtmvjUjWVq%2BEIvem2rwRrGhR13KYqCQKq5xSm3mP%2B8%3D' (2024-05-05)
• Updated input 'zls':
    'github:zigtools/zls/75bd32d1be6decda507aad9eb224803d2e8ae70d?narHash=sha256-3Cy6f3py/Errlie6osdYmmTPJWOgGLl5cuySXgjO/0w%3D' (2024-05-01)
  → 'github:zigtools/zls/f6817ed3ca4d70c2181f96fbbf84cb533cd7205e?narHash=sha256-EZpShJM2csFe%2BEBFJyjVWs6/nPvQwiMuuWsmeltEMXg%3D' (2024-05-03)
2024-05-05 14:46:49 -05:00
12 changed files with 105 additions and 106 deletions

View File

@ -193,27 +193,26 @@
"hyprland": {
"inputs": {
"hyprcursor": "hyprcursor",
"hyprland-protocols": "hyprland-protocols",
"hyprlang": "hyprlang",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs_2",
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1714568252,
"narHash": "sha256-sPHpRfM+D5P4ZuADRSCiAhhk1/ZQHHX0SYUIoD2l4DQ=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "4ed6b69b68a544a81cec583a1ad8aff218f7db5d",
"type": "github"
"lastModified": 1714933694,
"narHash": "sha256-gziEBZF1wmBBw3v0Ang3nN3QwoQWtFmBIORODJt38TE=",
"ref": "refs/heads/main",
"rev": "cddeec47a1fc0e70d8598fd10c29cd0e9489999f",
"revCount": 4617,
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
},
"original": {
"owner": "hyprwm",
"ref": "main",
"repo": "Hyprland",
"type": "github"
"submodules": true,
"type": "git",
"url": "https://github.com/hyprwm/Hyprland"
}
},
"hyprland-contrib": {
@ -238,19 +237,21 @@
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
],
"systems": [
"hyprland",
"xdph",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"lastModified": 1714869498,
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161",
"type": "github"
},
"original": {
@ -296,11 +297,11 @@
]
},
"locked": {
"lastModified": 1714171579,
"narHash": "sha256-eaWDIvt8ufUKKz3Lc2a3PyemLJG1m9RYlF+HP3hWbaw=",
"lastModified": 1714755542,
"narHash": "sha256-D0pg+ZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "126dad854f22fe30e6b82cd21808e76903d90ac5",
"rev": "1270ebaa539e56d61b708c24b072b09cbbd3a828",
"type": "github"
},
"original": {
@ -327,11 +328,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1714306226,
"narHash": "sha256-CA7bfnDt9TcFc7I8eKHf72DodYUEETDPgmBFXBRP9/E=",
"lastModified": 1714910950,
"narHash": "sha256-gaq5bphSsY+htEXFDkImOrH3MVCkxFTvCiwdCJj096E=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "49d9b510614b9bd137e067eb31445a8feca83313",
"rev": "26fabca301e1133abd3d9192b1bcb6fb45b30f1d",
"type": "github"
},
"original": {
@ -390,11 +391,11 @@
]
},
"locked": {
"lastModified": 1714273701,
"narHash": "sha256-bmoeZ5zMSSO/e8P51yjrzaxA9uzA3SZAEFvih6S3LFo=",
"lastModified": 1714878592,
"narHash": "sha256-E68C03sYRsYFsK7wiGHUIJm8IsyPRALOrFoTL0glXnI=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "941c4973c824509e0356be455d89613611f76c8a",
"rev": "a362555e9dbd4ecff3bb98969bbdb8f79fe87f10",
"type": "github"
},
"original": {
@ -421,11 +422,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1714265296,
"narHash": "sha256-jVnKiCOoFulPT1zDdA4jfG/lnEnngdth5CT6rVDXEJ4=",
"lastModified": 1714870069,
"narHash": "sha256-CNCqCGOHdxuiVnVkhTpp2WcqSSmSfeQjubhDOcgwGjU=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "ade4fb7bbf04cd52bc1705734d5dc67755d77ec9",
"rev": "4b620020fd73bdd5104e32c702e65b60b6869426",
"type": "github"
},
"original": {
@ -442,11 +443,11 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1714525911,
"narHash": "sha256-XYARtyCpKeL0IosMSzeHl6YFblV3n4y7plM+K9fg4N4=",
"lastModified": 1714926024,
"narHash": "sha256-LbSVziNYk/nxfYeyxKNhV/ryfbCUUZVlWoG5KG0sOxk=",
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"rev": "4cbf82124f2c03fa5b1b669771c48f9927264684",
"rev": "eb44cc5dcc75c33e7f246c9f38b96f158b3f6e9d",
"type": "github"
},
"original": {
@ -457,11 +458,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1713714899,
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
"lastModified": 1714253743,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
"type": "github"
},
"original": {
@ -489,11 +490,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1714656196,
"narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=",
"lastModified": 1714809261,
"narHash": "sha256-hfBmnYFyz9I1mdrC3tX1A+dF9cOUcds5PIMPxrT+cRk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "94035b482d181af0a0f8f77823a790b256b7c3cc",
"rev": "d32560238207b8e26d88b265207b216ee46b8450",
"type": "github"
},
"original": {
@ -521,11 +522,11 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1714253743,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
"lastModified": 1714763106,
"narHash": "sha256-DrDHo74uTycfpAF+/qxZAMlP/Cpe04BVioJb6fdI0YY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
"rev": "e9be42459999a253a9f92559b1f5b72e1b44c13d",
"type": "github"
},
"original": {
@ -572,11 +573,11 @@
},
"stable": {
"locked": {
"lastModified": 1714409183,
"narHash": "sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH+RU=",
"lastModified": 1714782413,
"narHash": "sha256-tbg0MEuKaPcUrnmGCu4xiY5F+7LW2+ECPKVAJd2HLwM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "576ecd43d3b864966b4423a853412d6177775e8b",
"rev": "651b4702e27a388f0f18e1b970534162dec09aff",
"type": "github"
},
"original": {
@ -690,29 +691,9 @@
"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": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"hyprland-protocols": "hyprland-protocols",
"hyprlang": [
"hyprland",
"hyprlang"
@ -727,11 +708,11 @@
]
},
"locked": {
"lastModified": 1713724432,
"narHash": "sha256-dtU1y4oj/0Y42oauzm93ucFg1AoqETnQ21bmXTIUng0=",
"lastModified": 1714060055,
"narHash": "sha256-j43TS9wv9luaAlpxcxw0sjxkbcc2mGANVR2RYgo3RCw=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "9ace6f969ce495185df34cc6254fb9d297765478",
"rev": "0fe840441e43da12cd7865ed9aa8cdc35a8da85a",
"type": "github"
},
"original": {
@ -771,11 +752,11 @@
]
},
"locked": {
"lastModified": 1714526316,
"narHash": "sha256-Gv8hKB0JKQn3xFekNcu1Mz/UgTkqS9ypSXVrUZ0NTrs=",
"lastModified": 1714871906,
"narHash": "sha256-HDtmvjUjWVq+EIvem2rwRrGhR13KYqCQKq5xSm3mP+8=",
"owner": "Cloudef",
"repo": "zig2nix",
"rev": "825245d8809e086f9207f77f1e7a5c1fd7799c7e",
"rev": "deb76120bc98822cfa66c33778562214479eb050",
"type": "github"
},
"original": {
@ -795,11 +776,11 @@
"zig-overlay": "zig-overlay"
},
"locked": {
"lastModified": 1714570733,
"narHash": "sha256-3Cy6f3py/Errlie6osdYmmTPJWOgGLl5cuySXgjO/0w=",
"lastModified": 1714726694,
"narHash": "sha256-EZpShJM2csFe+EBFJyjVWs6/nPvQwiMuuWsmeltEMXg=",
"owner": "zigtools",
"repo": "zls",
"rev": "75bd32d1be6decda507aad9eb224803d2e8ae70d",
"rev": "f6817ed3ca4d70c2181f96fbbf84cb533cd7205e",
"type": "github"
},
"original": {

View File

@ -10,7 +10,9 @@
tsm.url = "github:daylinmorgan/tsm?dir=nix";
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";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";

View File

@ -54,7 +54,9 @@ mkOizysModule config "hyprland" {
nixpkgs.overlays = [
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...
# Must have been one of the other non-hyprland packages modified in the overlay
# inputs.hyprland.overlays.default

View File

@ -5,16 +5,15 @@ import (
"oizys/pkg/oizys"
)
var bootCmd = &cobra.Command{
Use: "boot",
Short: "nixos rebuild boot",
Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake)
oizys.NixosRebuild("boot", flake)
},
}
func init() {
rootCmd.AddCommand(bootCmd)
rootCmd.AddCommand(bootCmd)
}

View File

@ -5,17 +5,15 @@ import (
"oizys/pkg/oizys"
)
var buildCmd = &cobra.Command{
Use: "build",
Short: "A brief description of your command",
Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake)
oizys.NixBuild(oizys.Output(flake, host), args...)
},
}
func init() {
rootCmd.AddCommand(buildCmd)
rootCmd.AddCommand(buildCmd)
}

View File

@ -9,6 +9,7 @@ var cacheCmd = &cobra.Command{
Use: "cache",
Short: "build and push to cachix",
Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake)
oizys.CacheBuild(oizys.Output(flake, host), cacheName, args...)
},
}
@ -16,10 +17,10 @@ var cacheCmd = &cobra.Command{
func init() {
cacheCmd.Flags().StringVarP(
&cacheName,
"cache",
"c",
"daylin",
"name of cachix binary cache",
"cache",
"c",
"daylin",
"name of cachix binary cache",
)
rootCmd.AddCommand(cacheCmd)
}

View File

@ -1,19 +1,20 @@
package cmd
import (
"oizys/pkg/oizys"
"github.com/spf13/cobra"
"oizys/pkg/oizys"
"github.com/spf13/cobra"
)
var dryCmd = &cobra.Command{
Use: "dry",
Short: "poor man's nix flake check",
Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake)
oizys.NixDryRun(oizys.Output(flake, host))
},
}
func init() {
rootCmd.AddCommand(dryCmd)
rootCmd.AddCommand(dryCmd)
}

View File

@ -7,15 +7,15 @@ import (
"oizys/pkg/oizys"
)
var outputCmd = &cobra.Command{
Use: "output",
Short: "show nixosConfiguration attr",
Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake)
fmt.Println(oizys.Output(flake, host))
},
}
func init() {
rootCmd.AddCommand(outputCmd)
rootCmd.AddCommand(outputCmd)
}

View File

@ -1,9 +1,7 @@
package cmd
import (
"errors"
"fmt"
"io/fs"
"log"
"os"
@ -21,10 +19,6 @@ func setFlake() {
flake = oizysDir
}
}
if _, err := os.Stat(flake); errors.Is(err, fs.ErrNotExist) {
log.Fatalln("path to flake:", flake, "does not exist")
}
}
func setHost() {
@ -69,7 +63,6 @@ var rootCmd = &cobra.Command{
},
}
func init() {
rootCmd.CompletionOptions.HiddenDefaultCmd = true
rootCmd.PersistentFlags().StringVar(&flake, "flake", "", "path to flake ($OIZYS_DIR or $HOME/oizys)")

View File

@ -9,11 +9,11 @@ var switchCmd = &cobra.Command{
Use: "switch",
Short: "nixos rebuild switch",
Run: func(cmd *cobra.Command, args []string) {
oizys.CheckFlake(flake)
oizys.NixosRebuild("switch", flake, args...)
},
}
func init() {
rootCmd.AddCommand(switchCmd)
rootCmd.AddCommand(switchCmd)
}

View File

@ -1,6 +1,9 @@
{
installShellFiles,
buildGoModule,
lib,
...
}:
buildGoModule {
pname = "oizys";
@ -8,4 +11,11 @@ buildGoModule {
src = lib.cleanSource ./.;
vendorHash = "sha256-kh/7dV49KaQcD9ho8IpBcRc6+05bn4XpMzAI9JXu7+o=";
nativeBuildInputs = [installShellFiles];
postInstall = ''
installShellCompletion --cmd oizys \
--zsh <($out/bin/oizys completion zsh)
'';
}

View File

@ -1,7 +1,9 @@
package oizys
import (
"errors"
"fmt"
"io/fs"
"log"
"os"
"os/exec"
@ -27,10 +29,10 @@ func TerminalSize() (int, int) {
func ParseDryRunOutput(nixOutput string) {
output := termenv.NewOutput(os.Stdout)
parts := strings.Split(nixOutput, "\nthese")
if len(parts) != 3 {
log.Println("no changes...")
return
}
if len(parts) != 3 {
log.Println("no changes...")
return
}
built := strings.Split(strings.TrimSpace(parts[1]), "\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) {
args := []string{subcmd, "--flake"}
args := []string{
"nixos-rebuild",
subcmd,
"--flake",
flake,
}
args = append(args, rest...)
cmd := exec.Command("nixos-rebuild", args...)
cmd := exec.Command("sudo", args...)
runCommand(cmd)
}
@ -88,7 +95,6 @@ func runCommand(cmd *exec.Cmd) {
func NixBuild(path string, rest ...string) {
args := []string{"build", path}
args = append(args, rest...)
fmt.Println(args)
cmd := exec.Command("nix", args...)
runCommand(cmd)
}
@ -104,6 +110,12 @@ func CacheBuild(path string, cache string, rest ...string) {
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 {
return fmt.Sprintf(
"%s#nixosConfigurations.%s.config.system.build.toplevel",