mirror of
https://github.com/Noratrieb/nixos.git
synced 2026-01-16 20:55:06 +01:00
home manager for laptop
This commit is contained in:
parent
d0d9400502
commit
31b5f8b4f2
6 changed files with 99 additions and 41 deletions
17
flake.nix
17
flake.nix
|
|
@ -32,11 +32,26 @@
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.nils = import ./home-manager/home.nix;
|
home-manager.users.nils = import ./home-manager/desktop.nix;
|
||||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Standalone home-manager configuration entrypoint
|
||||||
|
# Available through 'home-manager --flake .#nils@nixos'
|
||||||
|
homeConfigurations = {
|
||||||
|
"nilsh@LAPTOP-Nils" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||||
|
extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config
|
||||||
|
# > Our main home-manager configuration file <
|
||||||
|
modules = [
|
||||||
|
./home-manager/common.nix
|
||||||
|
./home-manager/laptop.nix
|
||||||
|
./home-manager/git.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
home-manager/common-packages.nix
Normal file
18
home-manager/common-packages.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{pkgs, ...}: with pkgs; [
|
||||||
|
bacon
|
||||||
|
bat
|
||||||
|
cargo-expand
|
||||||
|
cargo-nextest
|
||||||
|
fzf
|
||||||
|
gcc
|
||||||
|
gh
|
||||||
|
git-absorb
|
||||||
|
git-crypt
|
||||||
|
htop
|
||||||
|
hyperfine
|
||||||
|
inferno
|
||||||
|
python3
|
||||||
|
ripgrep
|
||||||
|
rustup-toolchain-install-master
|
||||||
|
samply
|
||||||
|
]
|
||||||
26
home-manager/common.nix
Normal file
26
home-manager/common.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ inputs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, pkgs
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
programs.neovim.enable = true;
|
||||||
|
|
||||||
|
home.file.".cargo/config.toml" = {
|
||||||
|
text = ''
|
||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
linker = "${pkgs.llvmPackages_16.clang}/bin/clang"
|
||||||
|
rustflags = ["-Clink-arg=-fuse-ld=${pkgs.mold}/bin/mold", "-Ctarget-cpu=native"]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||||
|
home.stateVersion = "22.11";
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ in
|
||||||
|
|
||||||
# You can also split up your configuration and import pieces of it here:
|
# You can also split up your configuration and import pieces of it here:
|
||||||
# ./nvim.nix
|
# ./nvim.nix
|
||||||
|
./common.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
./vscode.nix
|
./vscode.nix
|
||||||
|
|
@ -28,47 +29,18 @@ in
|
||||||
homeDirectory = "/home/nils";
|
homeDirectory = "/home/nils";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Add stuff for your user as you see fit:
|
|
||||||
programs.neovim.enable = true;
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
audacity
|
audacity
|
||||||
bacon
|
|
||||||
bat
|
|
||||||
cargo-expand
|
|
||||||
cargo-nextest
|
|
||||||
customPkgs.cargo-bisect-rustc
|
customPkgs.cargo-bisect-rustc
|
||||||
discord
|
discord
|
||||||
fzf
|
|
||||||
gcc
|
|
||||||
gh
|
|
||||||
git-absorb
|
|
||||||
git-crypt
|
|
||||||
htop
|
|
||||||
hyperfine
|
|
||||||
inferno
|
|
||||||
jetbrains.idea-ultimate
|
jetbrains.idea-ultimate
|
||||||
linuxKernel.packages.linux_6_1.perf
|
linuxKernel.packages.linux_6_1.perf
|
||||||
obs-studio
|
obs-studio
|
||||||
obsidian
|
obsidian
|
||||||
postman
|
postman
|
||||||
prismlauncher
|
prismlauncher
|
||||||
python3
|
|
||||||
ripgrep
|
|
||||||
rnix-lsp
|
|
||||||
rustup-toolchain-install-master
|
|
||||||
samply
|
|
||||||
spotify
|
spotify
|
||||||
];
|
] ++ import ./common-packages.nix { inherit pkgs; };
|
||||||
|
|
||||||
home.file.".cargo/config.toml" = {
|
|
||||||
text = ''
|
|
||||||
[target.x86_64-unknown-linux-gnu]
|
|
||||||
linker = "clang"
|
|
||||||
rustflags = ["-Clink-arg=-fuse-ld=${pkgs.mold}/bin/mold", "-Ctarget-cpu=native"]
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -77,14 +49,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zoxide = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Nicely reload system units when changing configs
|
# Nicely reload system units when changing configs
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
|
|
||||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
|
||||||
home.stateVersion = "22.11";
|
|
||||||
}
|
}
|
||||||
34
home-manager/laptop.nix
Normal file
34
home-manager/laptop.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{ inputs, pkgs, ... }: {
|
||||||
|
nixpkgs = {
|
||||||
|
# You can add overlays here
|
||||||
|
overlays = [
|
||||||
|
# If you want to use overlays exported from other flakes:
|
||||||
|
# neovim-nightly-overlay.overlays.default
|
||||||
|
# Or define it inline, for example:
|
||||||
|
# (final: prev: {
|
||||||
|
# hi = final.hello.overrideAttrs (oldAttrs: {
|
||||||
|
# patches = [ ./change-hello-to-hi.patch ];
|
||||||
|
# });
|
||||||
|
# })
|
||||||
|
inputs.nur.overlay
|
||||||
|
];
|
||||||
|
# Configure your nixpkgs instance
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
||||||
|
allowUnfreePredicate = (_: true);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = import ./common-packages.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
programs.fish.interactiveShellInit = ''
|
||||||
|
set fish_greeting # Disable greeting
|
||||||
|
. /home/nilsh/.nix-profile/etc/profile.d/nix.fish
|
||||||
|
'';
|
||||||
|
|
||||||
|
home = {
|
||||||
|
username = "nilsh";
|
||||||
|
homeDirectory = "/home/nilsh";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
package = pkgs.vscodium;
|
package = pkgs.vscodium;
|
||||||
enableUpdateCheck = false;
|
enableUpdateCheck = false;
|
||||||
mutableExtensionsDir = false;
|
mutableExtensionsDir = false;
|
||||||
settings = {
|
userSettings = {
|
||||||
"nix.enableLanguageServer" = true;
|
"nix.enableLanguageServer" = true;
|
||||||
"nix.serverPath" = "${pkgs.nil}/bin/nil";
|
"nix.serverPath" = "${pkgs.nil}/bin/nil";
|
||||||
"nix.serverSettings" = {
|
"nix.serverSettings" = {
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
redhat.vscode-yaml
|
redhat.vscode-yaml
|
||||||
mads-hartmann.bash-ide-vscode
|
mads-hartmann.bash-ide-vscode
|
||||||
ms-azuretools.vscode-docker
|
ms-azuretools.vscode-docker
|
||||||
|
# bmalehorn.vscode-fish
|
||||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||||
{
|
{
|
||||||
publisher = "dtsvet";
|
publisher = "dtsvet";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue