Implement nixgl and ghostty

This commit is contained in:
Arnie 2025-01-04 01:17:25 +01:00
parent a6999d5663
commit e9e0fe95a7
6 changed files with 125 additions and 47 deletions

View File

@ -0,0 +1 @@
alias hm-switch="home-manager switch --flake ~/.config/nix"

View File

@ -0,0 +1,2 @@
# Impure because of nixgl wrapper
alias hm-switch="home-manager switch --impure --flake ~/.config/nix"

View File

@ -14,6 +14,9 @@ in
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
nixGL.packages = pkgs.nixgl;
nixGL.defaultWrapper = "nvidia";
home.username = username; home.username = username;
home.homeDirectory = homedir; home.homeDirectory = homedir;
@ -33,6 +36,40 @@ in
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
programs.git = {
enable = true;
userName = "Arnie";
userEmail = "i@cechis.cz";
ignores = [
".vscode"
".direnv"
".devenv"
".envrc"
];
extraConfig = {
core = {
autocrlf = "input";
# TODO: Provide through nix
hooksPath = "~/.git/hooks";
editor = "vim";
};
pull.rebase = false;
init.defaultBranch = "main";
};
};
programs.ghostty = {
enable = true;
installVimSyntax = true;
enableZshIntegration = true;
package = config.lib.nixGL.wrap pkgs.ghostty;
};
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -78,30 +115,6 @@ in
''; '';
}; };
programs.git = {
enable = true;
userName = "Arnie";
userEmail = "i@cechis.cz";
ignores = [
".vscode"
".direnv"
".devenv"
".envrc"
];
extraConfig = {
core = {
autocrlf = "input";
# TODO: Provide through nix
hooksPath = "~/.git/hooks";
editor = "vim";
};
pull.rebase = false;
init.defaultBranch = "main";
};
};
home.sessionVariables = { home.sessionVariables = {
EDITOR = "vim"; EDITOR = "vim";
GO111MODULE = "on"; GO111MODULE = "on";

View File

@ -31,25 +31,6 @@ in
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
programs.zsh = {
enable = true;
dirHashes = {
mac = "${homedir}/.macshare";
};
initExtra = ''
for file in ${zshSourceCommon}/*.zsh; do
source "$file"
done
autoload -U +X bashcompinit && bashcompinit
source <(kubectl completion zsh)
complete -C '/usr/local/bin/aws_completer' aws
'';
};
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Lukas Cech"; userName = "Lukas Cech";
@ -74,6 +55,25 @@ in
}; };
}; };
programs.zsh = {
enable = true;
dirHashes = {
mac = "${homedir}/.macshare";
};
initExtra = ''
for file in ${zshSourceCommon}/*.zsh; do
source "$file"
done
autoload -U +X bashcompinit && bashcompinit
source <(kubectl completion zsh)
complete -C '/usr/local/bin/aws_completer' aws
'';
};
home.sessionVariables = { home.sessionVariables = {
EDITOR = "vim"; EDITOR = "vim";
GO111MODULE = "on"; GO111MODULE = "on";

View File

@ -1,5 +1,20 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -40,7 +55,41 @@
"type": "github" "type": "github"
} }
}, },
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1735948776,
"narHash": "sha256-QFZ3N23BdBJMJTANPQS5OZA23S1+iN1x5Aat6J1rQ1E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "268aaf5836297d28d2a225e6c5ff737cdffabc73",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1735821806, "lastModified": 1735821806,
"narHash": "sha256-cuNapx/uQeCgeuhUhdck3JKbgpsml259sjUQnWM7zW8=", "narHash": "sha256-cuNapx/uQeCgeuhUhdck3JKbgpsml259sjUQnWM7zW8=",
@ -60,7 +109,8 @@
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs" "nixgl": "nixgl",
"nixpkgs": "nixpkgs_2"
} }
} }
}, },

View File

@ -8,9 +8,10 @@
nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixgl.url = "github:nix-community/nixGL";
}; };
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager }: outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixgl }:
let let
darwin-common = { pkgs, ... }: darwin-common = { pkgs, ... }:
let let
@ -81,13 +82,24 @@
}; };
in in
{ {
homeConfigurations = { homeConfigurations = let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
nixgl.overlay
];
config = {
allowUnfree = true;
};
};
in{
# init with # init with
# nix run home-manager/master -- switch --flake ~/.config/nix # nix run home-manager/master -- switch --flake ~/.config/nix
# update with # update with
# home-manager switch --flake ~/.config/nix # home-manager switch --flake ~/.config/nix
"becky@dingleberry" = home-manager.lib.homeManagerConfiguration { "becky@dingleberry" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # pkgs = nixpkgs.legacyPackages.x86_64-linux;
inherit pkgs;
modules = [ modules = [
./devices/becky-dingleberry.nix ./devices/becky-dingleberry.nix