diff --git a/.zsh/common/05-home-manager.zsh b/.zsh/common/05-home-manager.zsh new file mode 100644 index 0000000..00f0bdd --- /dev/null +++ b/.zsh/common/05-home-manager.zsh @@ -0,0 +1 @@ +alias hm-switch="home-manager switch --flake ~/.config/nix" diff --git a/.zsh/dingleberry/05-home-manager.zsh b/.zsh/dingleberry/05-home-manager.zsh new file mode 100644 index 0000000..83cce35 --- /dev/null +++ b/.zsh/dingleberry/05-home-manager.zsh @@ -0,0 +1,2 @@ +# Impure because of nixgl wrapper +alias hm-switch="home-manager switch --impure --flake ~/.config/nix" diff --git a/devices/becky-dingleberry.nix b/devices/becky-dingleberry.nix index 3fffce9..08400bf 100644 --- a/devices/becky-dingleberry.nix +++ b/devices/becky-dingleberry.nix @@ -14,6 +14,9 @@ in # Let Home Manager install and manage itself. programs.home-manager.enable = true; + nixGL.packages = pkgs.nixgl; + nixGL.defaultWrapper = "nvidia"; + home.username = username; home.homeDirectory = homedir; @@ -33,6 +36,40 @@ in 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 = { 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 = { EDITOR = "vim"; GO111MODULE = "on"; diff --git a/devices/lcech-mac-veracode.nix b/devices/lcech-mac-veracode.nix index e05665f..aace18b 100644 --- a/devices/lcech-mac-veracode.nix +++ b/devices/lcech-mac-veracode.nix @@ -10,6 +10,9 @@ let zshSourceCommon = ../.zsh/common; in { + nixGL.packages = pkgs.nixgl; + nixGL.defaultWrapper = "nvidia"; + # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -31,25 +34,6 @@ in 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 = { enable = true; userName = "Lukas Cech"; @@ -74,6 +58,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 = { EDITOR = "vim"; GO111MODULE = "on"; diff --git a/flake.lock b/flake.lock index 113e6e4..b3a5864 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,20 @@ { "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": { "inputs": { "nixpkgs": [ @@ -40,6 +55,27 @@ "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": { "locked": { "lastModified": 1735821806, @@ -60,6 +96,7 @@ "inputs": { "home-manager": "home-manager", "nix-darwin": "nix-darwin", + "nixgl": "nixgl", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index a080ed0..be4fcd7 100644 --- a/flake.nix +++ b/flake.nix @@ -8,9 +8,11 @@ nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixgl.url = "github:nix-community/nixGL"; + nixgl.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager }: + outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, nixgl }: let darwin-common = { pkgs, ... }: let @@ -81,13 +83,24 @@ }; in { - homeConfigurations = { + homeConfigurations = let + pkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ + nixgl.overlay + ]; + config = { + allowUnfree = true; + }; + }; + in{ # init with # nix run home-manager/master -- switch --flake ~/.config/nix # update with # home-manager switch --flake ~/.config/nix "becky@dingleberry" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; + # pkgs = nixpkgs.legacyPackages.x86_64-linux; + inherit pkgs; modules = [ ./devices/becky-dingleberry.nix