setup-env #1
12
README.md
12
README.md
@@ -1,3 +1,13 @@
|
|||||||
# setup-machines
|
# setup-machines
|
||||||
|
|
||||||
This repo contains all the tools to correctly setup all the needed tools on a machine from clean install
|
This repo contains all the tools to correctly setup all the needed tools on a machine from clean install
|
||||||
|
|
||||||
|
[home-manager manual](https://nix-community.github.io/home-manager/index.xhtml)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
home-manager switch --flake ".#noahk@NixOS_Desktop"
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo nixos-rebuild switch --flake ".#NixOS_Desktop"
|
||||||
|
```
|
||||||
|
16
flake.lock
generated
16
flake.lock
generated
@@ -7,32 +7,32 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720042825,
|
"lastModified": 1739757849,
|
||||||
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
|
"narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
|
"rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-24.05",
|
"ref": "release-24.11",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723938990,
|
"lastModified": 1740463929,
|
||||||
"narHash": "sha256-9tUadhnZQbWIiYVXH8ncfGXGvkNq3Hag4RCBEMUk7MI=",
|
"narHash": "sha256-4Xhu/3aUdCKeLfdteEHMegx5ooKQvwPHNkOgNCXQrvc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c42fcfbdfeae23e68fc520f9182dde9f38ad1890",
|
"rev": "5d7db4668d7a0c6cc5fc8cf6ef33b008b2b1ed8b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-24.05",
|
"ref": "nixos-24.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
description = "A very basic flake";
|
description = "A very basic flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||||
|
|
||||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
home-manager.url = "github:nix-community/home-manager/release-24.11";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
7
home-manager/IDEs/default.nix
Normal file
7
home-manager/IDEs/default.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./vscode.nix
|
||||||
|
];
|
||||||
|
}
|
16
home-manager/IDEs/vscode.nix
Normal file
16
home-manager/IDEs/vscode.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.vscode = {
|
||||||
|
enable = true;
|
||||||
|
extensions = with pkgs.vscode-extensions; [
|
||||||
|
catppuccin.catppuccin-vsc
|
||||||
|
catppuccin.catppuccin-vsc-icons
|
||||||
|
|
||||||
|
jnoortheen.nix-ide
|
||||||
|
mhutchie.git-graph
|
||||||
|
donjayamanne.githistory
|
||||||
|
eamodio.gitlens
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
42
home-manager/git/default.nix
Normal file
42
home-manager/git/default.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.gitFull;
|
||||||
|
|
||||||
|
delta.enable = true;
|
||||||
|
|
||||||
|
userName = "Noah Knegt";
|
||||||
|
userEmail = "personal@noahknegt.com";
|
||||||
|
|
||||||
|
signing = {
|
||||||
|
key = "~/.ssh/id_ed25519.pub";
|
||||||
|
signByDefault = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
gpg = { format = "ssh"; };
|
||||||
|
push = { autoSetupRemote = true; };
|
||||||
|
pull = { rebase = true; };
|
||||||
|
fetch = { prune = true; };
|
||||||
|
};
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
{
|
||||||
|
condition = "gitdir:~/git.noahknegt.com";
|
||||||
|
path = "~/.config/git/git.noahknegt.com.gitconfig";
|
||||||
|
contents = {
|
||||||
|
userEmail = "git@noahknegt.com";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
condition = "gitdir:~/open-source";
|
||||||
|
path = "~/.config/git/open-source.gitconfig";
|
||||||
|
contents = {
|
||||||
|
userEmail = "git@noahknegt.com";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@@ -14,6 +14,13 @@
|
|||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
|
./IDEs
|
||||||
|
|
||||||
|
./tools
|
||||||
|
|
||||||
|
./git
|
||||||
|
./zsh
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
@@ -39,21 +46,26 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
username = noahk;
|
username = "noahk";
|
||||||
homeDirectory = /home/noahk/;
|
homeDirectory = "/home/noahk";
|
||||||
|
|
||||||
|
packages = [
|
||||||
|
(pkgs.nerdfonts.override { fonts = [ "SourceCodePro" ]; })
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
# Add stuff for your user as you see fit:
|
# Add stuff for your user as you see fit:
|
||||||
# programs.neovim.enable = true;
|
# programs.neovim.enable = true;
|
||||||
# home.packages = with pkgs; [ steam ];
|
# home.packages = with pkgs; [ steam ];
|
||||||
|
|
||||||
# Enable home-manager and git
|
# Enable home-manager and git
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
programs.git.enable = 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
|
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||||
home.stateVersion = 24.05;
|
home.stateVersion = "24.11";
|
||||||
}
|
}
|
||||||
|
7
home-manager/tools/bat.nix
Normal file
7
home-manager/tools/bat.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.bat = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
11
home-manager/tools/default.nix
Normal file
11
home-manager/tools/default.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./bat.nix
|
||||||
|
./eza.nix
|
||||||
|
./fzf.nix
|
||||||
|
./ripgrep.nix
|
||||||
|
./tmux.nix
|
||||||
|
];
|
||||||
|
}
|
16
home-manager/tools/eza.nix
Normal file
16
home-manager/tools/eza.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.eza = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
|
||||||
|
colors = "always";
|
||||||
|
icons = "always";
|
||||||
|
git = true;
|
||||||
|
|
||||||
|
extraOptions = [
|
||||||
|
"--group-directories-first"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
9
home-manager/tools/fzf.nix
Normal file
9
home-manager/tools/fzf.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
7
home-manager/tools/ripgrep.nix
Normal file
7
home-manager/tools/ripgrep.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.ripgrep = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
7
home-manager/tools/tmux.nix
Normal file
7
home-manager/tools/tmux.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
33
home-manager/zsh/antidote.nix
Normal file
33
home-manager/zsh/antidote.nix
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zsh.antidote = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
# popular fish-like plugins
|
||||||
|
"mattmc3/zfunctions"
|
||||||
|
"zsh-users/zsh-autosuggestions"
|
||||||
|
"zdharma-continuum/fast-syntax-highlighting kind:defer"
|
||||||
|
"zsh-users/zsh-history-substring-search"
|
||||||
|
|
||||||
|
# set up Zsh completions with plugins
|
||||||
|
"mattmc3/ez-compinit"
|
||||||
|
"zsh-users/zsh-completions kind:fpath path:src"
|
||||||
|
|
||||||
|
# frameworks like oh-my-zsh are supported
|
||||||
|
"getantidote/use-omz" # handle OMZ dependencies
|
||||||
|
"ohmyzsh/ohmyzsh path:lib" # load OMZ's library
|
||||||
|
|
||||||
|
# List of plugins
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/extract"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/fzf"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/git"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/git-auto-fetch"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/gitignore"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/jsontools"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/sudo"
|
||||||
|
"ohmyzsh/ohmyzsh path:plugins/tmux"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
10
home-manager/zsh/default.nix
Normal file
10
home-manager/zsh/default.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./antidote.nix
|
||||||
|
./starship.nix
|
||||||
|
./zoxide.nix
|
||||||
|
./zsh.nix
|
||||||
|
];
|
||||||
|
}
|
8
home-manager/zsh/starship.nix
Normal file
8
home-manager/zsh/starship.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
}
|
8
home-manager/zsh/zoxide.nix
Normal file
8
home-manager/zsh/zoxide.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
}
|
28
home-manager/zsh/zsh.nix
Normal file
28
home-manager/zsh/zsh.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
|
||||||
|
history = {
|
||||||
|
append = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
shellAliases = {
|
||||||
|
ls = "eza";
|
||||||
|
ll = "eza -lh";
|
||||||
|
lal = "eza -lah";
|
||||||
|
|
||||||
|
cd = "z";
|
||||||
|
|
||||||
|
grep = "rg";
|
||||||
|
|
||||||
|
cat = "bat";
|
||||||
|
less = "bat --pager=less";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@@ -32,11 +32,23 @@
|
|||||||
channel.enable = false;
|
channel.enable = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
networking = {
|
||||||
|
hostName = "NixOS_Desktop"; # Define your hostname.
|
||||||
|
networkmanager.enable = true;
|
||||||
|
|
||||||
|
firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
# Allow discovery for spotify on the network
|
||||||
|
57621
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
# Allow discovery for spotify on the network
|
||||||
|
5353
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
networking.hostName = "NixOS_Desktop"; # Define your hostname.
|
|
||||||
|
|
||||||
# Enable networking
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Amsterdam";
|
time.timeZone = "Europe/Amsterdam";
|
||||||
@@ -56,15 +68,14 @@
|
|||||||
LC_TIME = "nl_NL.UTF-8";
|
LC_TIME = "nl_NL.UTF-8";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
# Configure X11
|
||||||
services.xserver.enable = true;
|
|
||||||
|
|
||||||
# Enable the XFCE Desktop Environment.
|
|
||||||
services.xserver.displayManager.lightdm.enable = true;
|
|
||||||
services.xserver.desktopManager.xfce.enable = true;
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# XFCE
|
||||||
|
displayManager.lightdm.enable = true;
|
||||||
|
desktopManager.xfce.enable = true;
|
||||||
|
|
||||||
xkb.layout = "us";
|
xkb.layout = "us";
|
||||||
xkb.variant = "";
|
xkb.variant = "";
|
||||||
};
|
};
|
||||||
@@ -88,11 +99,14 @@
|
|||||||
#media-session.enable = true;
|
#media-session.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||||
users.users.noahk = {
|
users.users.noahk = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Noah Knegt";
|
description = "Noah Knegt";
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Install firefox.
|
# Install firefox.
|
||||||
@@ -109,6 +123,9 @@
|
|||||||
papirus-icon-theme
|
papirus-icon-theme
|
||||||
# Menu kind
|
# Menu kind
|
||||||
xfce.xfce4-whiskermenu-plugin
|
xfce.xfce4-whiskermenu-plugin
|
||||||
|
|
||||||
|
# Spotify
|
||||||
|
spotify
|
||||||
];
|
];
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
@@ -117,6 +134,5 @@
|
|||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user