mirror of
https://github.com/RGBCube/ncc
synced 2025-08-02 13:07:46 +00:00
Compare commits
No commits in common. "86f136d9fd7cc2f3b736124a514e0a3043dad967" and "b3af8158a78fe0ab72d3043f032768fcec9fba56" have entirely different histories.
86f136d9fd
...
b3af8158a7
5 changed files with 7 additions and 41 deletions
|
@ -54,11 +54,7 @@ in {
|
||||||
nix.optimise.automatic = true;
|
nix.optimise.automatic = true;
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.nh.overrideAttrs (old: {
|
pkgs.nh
|
||||||
patches = old.patches or [] ++ [
|
|
||||||
./nh.patch
|
|
||||||
];
|
|
||||||
}))
|
|
||||||
pkgs.nix-index
|
pkgs.nix-index
|
||||||
pkgs.nix-output-monitor
|
pkgs.nix-output-monitor
|
||||||
];
|
];
|
|
@ -1,28 +0,0 @@
|
||||||
diff --git i/src/darwin.rs w/src/darwin.rs
|
|
||||||
index 64cdbd5..8bd337c 100644
|
|
||||||
--- i/src/darwin.rs
|
|
||||||
+++ w/src/darwin.rs
|
|
||||||
@@ -46,7 +46,7 @@ impl DarwinRebuildArgs {
|
|
||||||
fn rebuild(self, variant: &DarwinRebuildVariant) -> Result<()> {
|
|
||||||
use DarwinRebuildVariant::{Build, Switch};
|
|
||||||
|
|
||||||
- if nix::unistd::Uid::effective().is_root() {
|
|
||||||
+ if nix::unistd::Uid::effective().is_root() && !self.bypass_root_check {
|
|
||||||
bail!("Don't run nh os as root. I will call sudo internally as needed");
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git i/src/interface.rs w/src/interface.rs
|
|
||||||
index a7e199c..fc63b10 100644
|
|
||||||
--- i/src/interface.rs
|
|
||||||
+++ w/src/interface.rs
|
|
||||||
@@ -595,6 +595,10 @@ pub struct DarwinRebuildArgs {
|
|
||||||
/// Extra arguments passed to nix build
|
|
||||||
#[arg(last = true)]
|
|
||||||
pub extra_args: Vec<String>,
|
|
||||||
+
|
|
||||||
+ /// Don't panic if calling nh as root
|
|
||||||
+ #[arg(short = 'R', long, env = "NH_BYPASS_ROOT_CHECK")]
|
|
||||||
+ pub bypass_root_check: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DarwinRebuildArgs {
|
|
|
@ -1,7 +1,5 @@
|
||||||
{
|
{
|
||||||
system.defaults.CustomSystemPreferences."org.hammerspoon.Hammerspoon".MJConfigFile = "~/.config/hammerspoon/init.lua";
|
|
||||||
|
|
||||||
home-manager.sharedModules = [{
|
home-manager.sharedModules = [{
|
||||||
xdg.configFile."hammerspoon/init.lua".text = "";
|
home.file.".hammerspoon/init.lua".text = "";
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.sharedModules = [{
|
home-manager.sharedModules = [{
|
||||||
xdg.configFile."hammerspoon/Spoons/PaperWM.spoon" = {
|
home.file.".hammerspoon/Spoons/PaperWM.spoon" = {
|
||||||
recursive = true;
|
recursive = true;
|
||||||
|
|
||||||
source = pkgs.fetchFromGitHub {
|
source = pkgs.fetchFromGitHub {
|
||||||
|
@ -71,7 +71,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."hammerspoon/Spoons/Swipe.spoon" = {
|
home.file.".hammerspoon/Spoons/Swipe.spoon" = {
|
||||||
recursive = true;
|
recursive = true;
|
||||||
|
|
||||||
source = pkgs.fetchFromGitHub {
|
source = pkgs.fetchFromGitHub {
|
||||||
|
@ -82,7 +82,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."hammerspoon/init.lua".text = mkAfter /* lua */ ''
|
home.file.".hammerspoon/init.lua".text = mkAfter /* lua */ ''
|
||||||
---@type table
|
---@type table
|
||||||
_G.hs = _G.hs
|
_G.hs = _G.hs
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ in {
|
||||||
local button = hs.menubar.new()
|
local button = hs.menubar.new()
|
||||||
button:setTitle(hs.styledtext.new(title, attributes))
|
button:setTitle(hs.styledtext.new(title, attributes))
|
||||||
button:setClickCallback(function()
|
button:setClickCallback(function()
|
||||||
gotoSpace(index)
|
gotoSpace(space)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
table.insert(space_buttons, button)
|
table.insert(space_buttons, button)
|
||||||
|
|
|
@ -60,7 +60,7 @@ def main --wrapped [
|
||||||
] | append ($args_split | get --ignore-errors 1 | default [])
|
] | append ($args_split | get --ignore-errors 1 | default [])
|
||||||
|
|
||||||
if (uname | get kernel-name) == "Darwin" {
|
if (uname | get kernel-name) == "Darwin" {
|
||||||
sudo NH_BYPASS_ROOT_CHECK=true NH_NO_CHECKS=true nh darwin switch . ...$nh_flags -- ...$nix_flags
|
NH_BYPASS_ROOT_CHECK=true NH_NO_CHECKS=true nh darwin switch . ...$nh_flags -- ...$nix_flags
|
||||||
} else {
|
} else {
|
||||||
NH_BYPASS_ROOT_CHECK=true NH_NO_CHECKS=true nh os switch . ...$nh_flags -- ...$nix_flags
|
NH_BYPASS_ROOT_CHECK=true NH_NO_CHECKS=true nh os switch . ...$nh_flags -- ...$nix_flags
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue