feat: add everything

This commit is contained in:
Yadunand Prem 2024-04-24 11:13:31 +08:00
parent dc4f1537d8
commit 79cb717ee5
No known key found for this signature in database
8 changed files with 187 additions and 52 deletions

View File

@ -6,6 +6,7 @@
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, home-manager, agenix, ... }@inputs: { outputs = { self, nixpkgs, home-manager, agenix, ... }@inputs: {
@ -13,15 +14,15 @@
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./configuration.nix ./configuration.nix
agenix.nixosModules.default agenix.nixosModules.default
{ _module.args = { inherit inputs; };} { _module.args = { inherit inputs; };}
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.yadunut = import ./home.nix; home-manager.users.yadunut = import ./home.nix;
} }
]; ];
}; };
}; };

View File

@ -7,26 +7,42 @@
ripgrep ripgrep
]; ];
programs.zsh.enable = true; imports = [
programs.zoxide.enable = true; (import ../modules/zsh.nix)
programs.zoxide.enableZshIntegration = true; (import ../modules/git.nix)
programs.starship.enable = true; (import ../modules/neovim.nix)
];
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
config = {
hide_env_diff = true;
};
};
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.lazygit.enable = true; programs.lazygit.enable = true;
programs.git = { programs.git = {
enable = true;
userName = "Yadunand Prem";
userEmail = "yadunand@yadunut.com";
delta.enable = true;
lfs.enable = true;
extraConfig = { extraConfig = {
commit.gpgsign = true;
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub"; user.signingkey = "~/.ssh/id_ed25519.pub";
}; };
}; };
programs.tmux = {
enable = true;
newSession = true;
mouse = true;
keyMode = "vi";
plugins = with pkgs.tmuxPlugins; [
sensible
sessionist
pain-control
];
};
home.stateVersion = "23.11"; home.stateVersion = "23.11";
} }

View File

@ -1,8 +1,51 @@
{ {
"nodes": { "nodes": {
"agenix": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1712079060,
"narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=",
"owner": "ryantm",
"repo": "agenix",
"rev": "1381a759b205dff7a6818733118d02253340fd5e",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1700795494,
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -19,6 +62,27 @@
} }
}, },
"home-manager": { "home-manager": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1703113217,
"narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -39,6 +103,22 @@
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1703013332,
"narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1712608508, "lastModified": 1712608508,
"narHash": "sha256-vMZ5603yU0wxgyQeHJryOI+O61yrX2AHwY6LOFyV1gM=", "narHash": "sha256-vMZ5603yU0wxgyQeHJryOI+O61yrX2AHwY6LOFyV1gM=",
@ -56,9 +136,10 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs_2"
} }
}, },
"systems": { "systems": {
@ -75,6 +156,21 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -4,6 +4,7 @@
inputs = { inputs = {
# Specify the source of Home Manager and Nixpkgs. # Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -11,16 +12,31 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { nixpkgs, home-manager, flake-utils, ... }: { outputs = { nixpkgs, home-manager, flake-utils, agenix, ... }@inputs: {
homeConfigurations."yadunut@yadunut-mbp" = home-manager.lib.homeManagerConfiguration { homeConfigurations."yadunut@yadunut-mbp" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-darwin; pkgs = import nixpkgs {
system = "aarch64-darwin";
config = {
allowUnfree = true;
};
};
modules = [ ./yadunut-mbp/home.nix ];
};
# Specify your home configuration modules here, for example, nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
# the path to your home.nix. system = "x86_64-linux";
modules = [ ./yadunut-mbp/home.nix ./modules/zsh.nix ./modules/neovim.nix ./modules/git.nix ];
# Optionally use extraSpecialArgs modules = [
# to pass through arguments to home.nix ./configuration.nix
agenix.nixosModules.default
{ _module.args = { inherit inputs; };}
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.yadunut = import ./home.nix;
}
];
}; };
}; };
} }

View File

@ -13,11 +13,8 @@
rebase.autostash = true; rebase.autostash = true;
core.excludefile = "~/.gitignore_global";
push.autoSetupRemote = true; push.autoSetupRemote = true;
commit.gpgsign = true; commit.gpgsign = true;
commit.verbose = true; commit.verbose = true;

View File

@ -3,6 +3,8 @@
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
viAlias = true;
vimAlias = true;
# extraLuaConfig = '' ''; # extraLuaConfig = '' '';
# extraPackages = [ ]; # extraPackages = [ ];
}; };

View File

@ -1,13 +1,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
home.packages = with pkgs; [
home.packages = [ zsh-completions
pkgs.zsh-completions bat
pkgs.bat fd
pkgs.fd htop
pkgs.htop ripgrep
pkgs.ripgrep wget
pkgs.wget
]; ];
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -17,17 +16,17 @@
editor.dotExpansion = true; editor.dotExpansion = true;
pmodules = [ pmodules = [
"environment" "environment"
"terminal" "terminal"
"utility" "utility"
"directory" "directory"
"editor" "editor"
"history" "history"
"syntax-highlighting" "syntax-highlighting"
"history-substring-search" "history-substring-search"
"autosuggestions" "autosuggestions"
"completion" "completion"
]; ];
}; };
shellAliases = { shellAliases = {
cat = "bat"; cat = "bat";
diff = "delta"; diff = "delta";

View File

@ -1,6 +1,11 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [
(import ../modules/zsh.nix)
(import ../modules/git.nix)
(import ../modules/neovim.nix)
];
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.
home.username = "yadunut"; home.username = "yadunut";
@ -25,6 +30,7 @@
pkgs.entr pkgs.entr
pkgs.fava pkgs.fava
pkgs.typst pkgs.typst
pkgs.typst-lsp
pkgs.lazygit pkgs.lazygit
# Neovim deps # Neovim deps
@ -43,7 +49,8 @@
# (pkgs.writeShellScriptBin "my-hello" '' # (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!" # echo "Hello, ${config.home.username}!"
# '') # '')
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'. # plain files is through 'home.file'.
@ -85,6 +92,7 @@
programs.git.extraConfig = { programs.git.extraConfig = {
gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
user.signingkey = "~/.ssh/yadunut_ed25519.pub"; user.signingkey = "~/.ssh/yadunut_ed25519.pub";
core.excludesFile = "~/.gitignore_global";
}; };
programs.gh = { programs.gh = {