Compare commits

..

No commits in common. "b0bffa1a1f35725d2ba9566d128a830ee5024667" and "861433055a56bb25074b19b9fd9de93f7034be53" have entirely different histories.

6 changed files with 54 additions and 52 deletions

View file

@ -341,11 +341,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1722800434, "lastModified": 1722519799,
"narHash": "sha256-0lvzOT3dQWlQ+zyOAhKTxFd9BWZw380ILDNpoGdtekA=", "narHash": "sha256-NXeB/KgCbklksgTfHNef0/CfTXmw88YOrh2Q/87S2RM=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "2b520571e897be2a0e88c8692da607b062000038", "rev": "ab0a3268e04f2295ec4455be90ce8d0c2b107b8d",
"revCount": 5051, "revCount": 5040,
"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": 1722636442, "lastModified": 1720709712,
"narHash": "sha256-+7IS0n3/F0I5j6ZbrVlLcIIPHY3o+/vLAqg/G48sG+w=", "narHash": "sha256-78j/cY+AXoMIqqiNc1vWx237EPfpERAcYsb57ABUbwQ=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "contrib", "repo": "contrib",
"rev": "9d67858b437d4a1299be496d371b66fc0d3e01f6", "rev": "65d42dcbfde2229a75ccdb195c318dfe241f9ade",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -518,11 +518,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1722773431, "lastModified": 1722168631,
"narHash": "sha256-puSEio9yjWojIBDBts4BSGZ43rv1LzIevdYOKmW/Mjg=", "narHash": "sha256-16XBXW86ceQC+jRx7feCREZo696kvIzpKYmN2LnKfaE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lib-aggregate", "repo": "lib-aggregate",
"rev": "04a4b4d84e02590715e753da3d35fb03cddc6425", "rev": "4ce8efe904950cd85bda9624ff1c2ec55fe2ab6f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -534,11 +534,11 @@
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1722643724, "lastModified": 1722529543,
"narHash": "sha256-FrM0DN/i5kKB06/4KYNkY3mMGpC5hYQhaKtx1mneReU=", "narHash": "sha256-IDr+fHKwmpaWi4hzD2RYLdiaGEFOrsFm+NeHKETxMhk=",
"rev": "66469fc281fc4abb3284574f77a8051fee8116b9", "rev": "61a93d53081141d4ab222dcb939dd5caa8ffc767",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/66469fc281fc4abb3284574f77a8051fee8116b9.tar.gz" "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/61a93d53081141d4ab222dcb939dd5caa8ffc767.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@ -618,11 +618,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722740924, "lastModified": 1722136042,
"narHash": "sha256-UQPgA5d8azLZuDHZMPmvDszhuKF1Ek89SrTRtqsQ4Ss=", "narHash": "sha256-x3FmT4QSyK28itMiR5zfYhUrG5nY+2dv+AIcKfmSp5A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "97ca0a0fca0391de835f57e44f369a283e37890f", "rev": "c0ca47e8523b578464014961059999d8eddd4aae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -694,11 +694,11 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1722732880, "lastModified": 1722128034,
"narHash": "sha256-do2Mfm3T6SR7a5A804RhjQ+JTsF5hk4JTPGjCTRM/m8=", "narHash": "sha256-L8rwzYPsLo/TYtydPJoQyYOfetuiyQYnTWYcyB8UE/s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "8bebd4c74f368aacb047f0141db09ec6b339733c", "rev": "d15f6f6021693898fcd2c6a9bb13707383da9bbc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -715,11 +715,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1722802723, "lastModified": 1722530466,
"narHash": "sha256-7Yrsx/qbGCojDFxHSMsehU6a9z8rHCUVgjalKxPW4Eg=", "narHash": "sha256-9YvLtuLAA+LVmfrvlOsynHkS0DRCYnHFEp72NfXFVnc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "7ff73584dfac4799a253e38c2aedae80b681dd7f", "rev": "0bbe640011f1350933109f5450b15f9bd1fb5e9f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -762,11 +762,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1722640603, "lastModified": 1722415718,
"narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", "narHash": "sha256-5US0/pgxbMksF92k1+eOa8arJTJiPvsdZj9Dl+vJkM4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", "rev": "c3392ad349a5227f4a3464dce87bcc5046692fce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -794,11 +794,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1722630782, "lastModified": 1722421184,
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=", "narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da", "rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -857,11 +857,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1722735731, "lastModified": 1722523856,
"narHash": "sha256-BN/+/y1zR3sU4KhTdfNkleYS79UEnnmKP9MmY4NHZ8M=", "narHash": "sha256-hjdIYAuQMWLtlxxj9GpgnfFgmGJhxDDYXnBvEVeNXG8=",
"owner": "roc-lang", "owner": "roc-lang",
"repo": "roc", "repo": "roc",
"rev": "d4d9f69d0fbefd331172c11e430a5f2ac98ee30b", "rev": "790eabd933e13b0836c6ec243c77f873a5956966",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1135,11 +1135,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722600600, "lastModified": 1721995783,
"narHash": "sha256-bRpvmyAvt4OFbQJlmAURyW1To8nlRjNcQJdbOyI1MLE=", "narHash": "sha256-GLI+3yaZn6hHvv6wnYJHGqPfX6G3tXJNrTi7qYV9u94=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "4c95bb8378ca31cc06eba0a9ee0c04851221c193", "rev": "d9099d32bb395be5ed7eeb12ea0145d476632bd1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1156,11 +1156,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722734830, "lastModified": 1722475688,
"narHash": "sha256-cTHYCv/I2P6/V9pUZ9iqwjr/9VIZ4f+aRqZJq6DWsac=", "narHash": "sha256-b9q/NoJ3I5LtXVvxxjxNRxDEVMd+1daVldCyAYH7aCU=",
"owner": "Cloudef", "owner": "Cloudef",
"repo": "zig2nix", "repo": "zig2nix",
"rev": "c45829191ae509708b929872845f75008942d9b5", "rev": "b368a9170c6d6727375d2f43baf2565280e86019",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1180,11 +1180,11 @@
"zig-overlay": "zig-overlay" "zig-overlay": "zig-overlay"
}, },
"locked": { "locked": {
"lastModified": 1722703886, "lastModified": 1722209386,
"narHash": "sha256-WtOixxAwZS1uTD5L66ms9ctA7gUdEIfzbsY1Gj+aV+4=", "narHash": "sha256-GAzXTJUJJIXrAlHkInSDwlnVQPL5BV1Enbj3R4ipGFk=",
"owner": "zigtools", "owner": "zigtools",
"repo": "zls", "repo": "zls",
"rev": "dfe958e4d1a9ba503cfafd39164f090daea70109", "rev": "eba1489b6ffa6db7f0eaefce6e06d53cd9066f7b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -41,7 +41,7 @@ in
options.oizys = { options.oizys = {
user = mkOption { user = mkOption {
type = lib.types.str; type = lib.types.string;
default = "daylin"; default = "daylin";
description = "main user account"; description = "main user account";
}; };

View file

@ -10,12 +10,10 @@ import (
) )
var validArgs = []string{ var validArgs = []string{
"switch", "boot", "test", "build", "dry-build", "switch", "boot", "test", "build", "dry-build", "dry-activate", "edit", "repl",
"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",
@ -23,14 +21,11 @@ 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( return fmt.Errorf("unexpected arg: %s\nexpected one of:\n %s", args[0], strings.Join(validArgs, ", "))
"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]

View file

@ -32,6 +32,7 @@ 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
@ -47,6 +48,7 @@ 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)
}, },
@ -74,6 +76,7 @@ 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")
} }

View file

@ -9,6 +9,7 @@ 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 (
@ -27,5 +28,4 @@ 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
) )

View file

@ -35,6 +35,7 @@ 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
@ -100,6 +101,9 @@ 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
@ -237,7 +241,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.debug { if o.verbose {
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...)