mirror of
https://github.com/Noratrieb/nixos.git
synced 2026-01-14 11:45: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.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; };
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# 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:
|
||||
# ./nvim.nix
|
||||
./common.nix
|
||||
./git.nix
|
||||
./firefox.nix
|
||||
./vscode.nix
|
||||
|
|
@ -28,47 +29,18 @@ in
|
|||
homeDirectory = "/home/nils";
|
||||
};
|
||||
|
||||
# Add stuff for your user as you see fit:
|
||||
programs.neovim.enable = true;
|
||||
home.packages = with pkgs; [
|
||||
audacity
|
||||
bacon
|
||||
bat
|
||||
cargo-expand
|
||||
cargo-nextest
|
||||
customPkgs.cargo-bisect-rustc
|
||||
discord
|
||||
fzf
|
||||
gcc
|
||||
gh
|
||||
git-absorb
|
||||
git-crypt
|
||||
htop
|
||||
hyperfine
|
||||
inferno
|
||||
jetbrains.idea-ultimate
|
||||
linuxKernel.packages.linux_6_1.perf
|
||||
obs-studio
|
||||
obsidian
|
||||
postman
|
||||
prismlauncher
|
||||
python3
|
||||
ripgrep
|
||||
rnix-lsp
|
||||
rustup-toolchain-install-master
|
||||
samply
|
||||
spotify
|
||||
];
|
||||
|
||||
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;
|
||||
] ++ import ./common-packages.nix { inherit pkgs; };
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
|
@ -77,14 +49,6 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
# Nicely reload system units when changing configs
|
||||
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,12 +4,12 @@
|
|||
package = pkgs.vscodium;
|
||||
enableUpdateCheck = false;
|
||||
mutableExtensionsDir = false;
|
||||
settings = {
|
||||
userSettings = {
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "${pkgs.nil}/bin/nil";
|
||||
"nix.serverSettings" = {
|
||||
formatting = {
|
||||
command = ["${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt"];
|
||||
command = [ "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
redhat.vscode-yaml
|
||||
mads-hartmann.bash-ide-vscode
|
||||
ms-azuretools.vscode-docker
|
||||
# bmalehorn.vscode-fish
|
||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
publisher = "dtsvet";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue