[nix] Load the zsh configs

This commit is contained in:
Alyxia Sother 2023-06-09 12:47:29 +02:00
parent f4619def12
commit 1b8db91b79
No known key found for this signature in database
GPG key ID: 01E16C4E775A37E4
3 changed files with 44 additions and 12 deletions

View file

@ -20,6 +20,24 @@
"type": "github" "type": "github"
} }
}, },
"dotfiles": {
"flake": false,
"locked": {
"lastModified": 1686302382,
"narHash": "sha256-BKJnBMPuFylshzuY8EQoyP6xuAGcxCauJspl1cVkg/A=",
"ref": "refs/heads/master",
"rev": "4ea89899caf8a0fd87cdfdc4601f7e79fc666c37",
"revCount": 360,
"submodules": true,
"type": "git",
"url": "https://github.com/keanuplayz/dotfiles"
},
"original": {
"submodules": true,
"type": "git",
"url": "https://github.com/keanuplayz/dotfiles"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -27,11 +45,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1686265152, "lastModified": 1686305101,
"narHash": "sha256-ArdPMx2G2rWlnGlqfIV+efTKXcN7F3W0/b5XKYq7n8E=", "narHash": "sha256-xCgeI+uTKay3Ab3tMdP9m9flIJbFkRMKwRAmg5PQhJQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2bbfc3a78afb4ea60345a5660d8d4173da66c884", "rev": "1e5d741ea3f3290d7ac06a02ded24bfdc7aadb37",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -42,11 +60,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1686087926, "lastModified": 1686265002,
"narHash": "sha256-mXzfJpCCT7Vup2sC3rZPB/AbEW+uBjwT027XWm7R6rA=", "narHash": "sha256-JcRprVevSl5JNCp2oHy8fd3zvTsnuQgVCay0/sP/1GE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9ea6dd599d2781168e36486745b5d17e826ab015", "rev": "9e447f1c786f9d1375c3c8b2bff2c9400c63a34e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -59,6 +77,7 @@
"root": { "root": {
"inputs": { "inputs": {
"darwin": "darwin", "darwin": "darwin",
"dotfiles": "dotfiles",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View file

@ -8,12 +8,19 @@
# nix will normally use the nixpkgs defined in home-managers inputs, we only want one copy of nixpkgs though # nix will normally use the nixpkgs defined in home-managers inputs, we only want one copy of nixpkgs though
darwin.url = "github:lnl7/nix-darwin"; darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs"; # ... darwin.inputs.nixpkgs.follows = "nixpkgs"; # ...
dotfiles = {
url = "https://github.com/keanuplayz/dotfiles";
type = "git";
submodules = true;
flake = false;
};
}; };
# add the inputs declared above to the argument attribute set # add the inputs declared above to the argument attribute set
outputs = { self, nixpkgs, home-manager, darwin }: { outputs = { self, nixpkgs, home-manager, dotfiles, darwin }: {
darwinConfigurations."alymac" = darwin.lib.darwinSystem { darwinConfigurations."alymac" = darwin.lib.darwinSystem {
system = "x86_64-darwin"; system = "x86_64-darwin";
specialArgs = { inherit dotfiles; };
modules = [ modules = [
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
./hosts/alymac/default.nix ./hosts/alymac/default.nix

View file

@ -1,19 +1,17 @@
# hosts/YourHostName/default.nix # hosts/YourHostName/default.nix
{ pkgs, ... }: { pkgs, dotfiles, ... }:
{ {
# Make sure the nix daemon always runs # Make sure the nix daemon always runs
services.nix-daemon.enable = true; services.nix-daemon.enable = true;
# Installs a version of nix, that dosen't need "experimental-features = nix-command flakes" in /etc/nix/nix.conf # Installs a version of nix, that dosen't need "experimental-features = nix-command flakes" in /etc/nix/nix.conf
# services.nix-daemon.package = pkgs.nixFlakes; # services.nix-daemon.package = pkgs.nixFlakes;
users.users.alyxia = { users.users.alyxia = {
name = "alyxia"; name = "alyxia";
home = "/Users/alyxia"; home = "/Users/alyxia";
}; };
# if you use zsh (the default on new macOS installations),
# you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes
programs.zsh.enable = true;
# bash is enabled by default
# enable the gpg agent by default # enable the gpg agent by default
programs.gnupg.agent.enable = true; programs.gnupg.agent.enable = true;
@ -21,6 +19,14 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
users.alyxia = { pkgs, ... }: { users.alyxia = { pkgs, ... }: {
programs.zsh = {
enable = true;
initExtra = ''
export GPG_TTY=$(tty)
source ${dotfiles}/zsh/zshrc
'';
};
programs.git = { programs.git = {
enable = true; enable = true;
package = pkgs.gitAndTools.gitFull; # contains git send-email et al package = pkgs.gitAndTools.gitFull; # contains git send-email et al