refactor: change structure and start using home-manager
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
# nixconfig
|
# 0x29a nixos config
|
||||||
|
|
||||||
personal nixos configuration files
|
personal nixos configuration files
|
||||||
|
|
||||||
|
## how to deploy
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ sudo nixos-rebuild switch --flake path:/home/aaron/git/nixconfig#default
|
||||||
|
```
|
||||||
|
|||||||
15
flake.lock
generated
15
flake.lock
generated
@@ -7,32 +7,31 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758463745,
|
"lastModified": 1763389499,
|
||||||
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=",
|
"narHash": "sha256-GuG3PW8U41f8XqROreZQaUvrcjQt+Gh92g16X7zBUck=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3",
|
"rev": "7538d965352d3bfd4c380f5b3aa618bc839a84b4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-25.05",
|
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763049705,
|
"lastModified": 1763283776,
|
||||||
"narHash": "sha256-A5LS0AJZ1yDPTa2fHxufZN++n8MCmtgrJDtxFxrH4S8=",
|
"narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3acb677ea67d4c6218f33de0db0955f116b7588c",
|
"rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-25.05",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|||||||
31
flake.nix
31
flake.nix
@@ -1,31 +1,26 @@
|
|||||||
{
|
{
|
||||||
description = "0x29a NixOS flake";
|
description = "0x29a NixOS flake config";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
url = "github:nixos/nixpkgs/nixos-25.05";
|
url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-25.05";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, home-manager, ... }: {
|
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
|
||||||
nixosConfigurations = {
|
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
|
||||||
nixos = nixpkgs.lib.nixosSystem {
|
system = "x86_64-linux";
|
||||||
modules = [
|
specialArgs = {inherit inputs;};
|
||||||
./configuration.nix
|
modules = [
|
||||||
|
./hosts/default/configuration.nix
|
||||||
# make home-manager a module of nixos
|
./hosts/default/hardware-configuration.nix
|
||||||
home-manager.nixosModules.home-manager
|
{ home-manager.users.aaron = import ./hosts/default/home.nix; }
|
||||||
{
|
home-manager.nixosModules.default
|
||||||
home-manager.useGlobalPkgs = true;
|
];
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.aaron = import ./home.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
50
home.nix
50
home.nix
@@ -1,50 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# user config
|
|
||||||
home.username = "aaron";
|
|
||||||
home.homeDirectory = "/home/aaron";
|
|
||||||
|
|
||||||
# Packages that should be installed to the user profile
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
fastfetch
|
|
||||||
zip
|
|
||||||
xz
|
|
||||||
unzip
|
|
||||||
p7zip
|
|
||||||
jq
|
|
||||||
mtr
|
|
||||||
iperf3
|
|
||||||
dnsutils
|
|
||||||
ldns
|
|
||||||
socat
|
|
||||||
nmap
|
|
||||||
cowsay
|
|
||||||
file
|
|
||||||
which
|
|
||||||
tree
|
|
||||||
zstd
|
|
||||||
gnupg
|
|
||||||
btop
|
|
||||||
iotop
|
|
||||||
iftop
|
|
||||||
strace
|
|
||||||
ltrace
|
|
||||||
lsof
|
|
||||||
sysstat
|
|
||||||
lm_sensors
|
|
||||||
ethtool
|
|
||||||
pciutils
|
|
||||||
usbutils
|
|
||||||
];
|
|
||||||
|
|
||||||
# configure git
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
userName = "aaron";
|
|
||||||
userEmail = "aaron@0x29a.ch";
|
|
||||||
};
|
|
||||||
|
|
||||||
# starting version
|
|
||||||
home.stateVersion = "25.05";
|
|
||||||
}
|
|
||||||
BIN
hosts/default/.home.nix.swp
Normal file
BIN
hosts/default/.home.nix.swp
Normal file
Binary file not shown.
@@ -1,34 +1,33 @@
|
|||||||
# 0x29a nixos conifg
|
# 0x29a nixos conifg
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ pkgs, lib, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
inputs.home-manager.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
# use flakes
|
# use flakes
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
# Use the systemd-boot EFI boot loader.
|
|
||||||
|
# configure bootloader
|
||||||
boot.loader.systemd-boot.enable = false;
|
boot.loader.systemd-boot.enable = false;
|
||||||
boot.loader.grub = {
|
boot.loader.grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"quiet"
|
"quiet"
|
||||||
"console.ttyS0,115200n8" # allow terminals on serial console
|
"console.ttyS0,115200n8" # allow terminals on serial console
|
||||||
];
|
];
|
||||||
|
# plymouth boot eye candy
|
||||||
# boot eye candy
|
|
||||||
boot.initrd.systemd.enable = true;
|
boot.initrd.systemd.enable = true;
|
||||||
boot.plymouth.enable = true;
|
boot.plymouth.enable = true;
|
||||||
boot.plymouth.theme = "spinner";
|
boot.plymouth.theme = "spinner";
|
||||||
|
|
||||||
# use latest kernel
|
# use latest kernel
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
@@ -41,15 +40,24 @@
|
|||||||
|
|
||||||
# time zone.
|
# time zone.
|
||||||
time.timeZone = "Europe/Amsterdam";
|
time.timeZone = "Europe/Amsterdam";
|
||||||
|
# select internationalisation properties
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
i18n.extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
console = {
|
console = {
|
||||||
font = "Lat2-Terminus16";
|
font = "Lat2-Terminus16";
|
||||||
keyMap = "de_CH-latin1";
|
keyMap = "de_CH-latin1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# xserver config
|
# xserver config
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
112
hosts/default/home.nix
Normal file
112
hosts/default/home.nix
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
|
# manage.
|
||||||
|
home.username = "aaron";
|
||||||
|
home.homeDirectory = "/home/aaron";
|
||||||
|
|
||||||
|
# This value determines the Home Manager release that your configuration is
|
||||||
|
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||||
|
# introduces backwards incompatible changes.
|
||||||
|
#
|
||||||
|
# You should not change this value, even if you update Home Manager. If you do
|
||||||
|
# want to update the value, then make sure to first check the Home Manager
|
||||||
|
# release notes.
|
||||||
|
home.stateVersion = "25.05"; # Please read the comment before changing.
|
||||||
|
|
||||||
|
# The home.packages option allows you to install Nix packages into your
|
||||||
|
# environment.
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# # Adds the 'hello' command to your environment. It prints a friendly
|
||||||
|
# # "Hello, world!" when run.
|
||||||
|
# pkgs.hello
|
||||||
|
|
||||||
|
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||||
|
# # overrides. You can do that directly here, just don't forget the
|
||||||
|
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
||||||
|
# # fonts?
|
||||||
|
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
||||||
|
|
||||||
|
# # You can also create simple shell scripts directly inside your
|
||||||
|
# # configuration. For example, this adds a command 'my-hello' to your
|
||||||
|
# # environment:
|
||||||
|
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||||
|
# echo "Hello, ${config.home.username}!"
|
||||||
|
# '')
|
||||||
|
fastfetch
|
||||||
|
zip
|
||||||
|
xz
|
||||||
|
unzip
|
||||||
|
p7zip
|
||||||
|
jq
|
||||||
|
mtr
|
||||||
|
iperf3
|
||||||
|
dnsutils
|
||||||
|
ldns
|
||||||
|
socat
|
||||||
|
nmap
|
||||||
|
cowsay
|
||||||
|
file
|
||||||
|
which
|
||||||
|
tree
|
||||||
|
zstd
|
||||||
|
gnupg
|
||||||
|
btop
|
||||||
|
iotop
|
||||||
|
iftop
|
||||||
|
strace
|
||||||
|
ltrace
|
||||||
|
lsof
|
||||||
|
sysstat
|
||||||
|
lm_sensors
|
||||||
|
ethtool
|
||||||
|
pciutils
|
||||||
|
usbutils
|
||||||
|
];
|
||||||
|
|
||||||
|
# configure git
|
||||||
|
programs.git.settings = {
|
||||||
|
enable = true;
|
||||||
|
userName = "aaron";
|
||||||
|
userEmail = "aaron@0x29a.ch";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||||
|
# plain files is through 'home.file'.
|
||||||
|
home.file = {
|
||||||
|
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||||
|
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||||
|
# # symlink to the Nix store copy.
|
||||||
|
# ".screenrc".source = dotfiles/screenrc;
|
||||||
|
|
||||||
|
# # You can also set the file content immediately.
|
||||||
|
# ".gradle/gradle.properties".text = ''
|
||||||
|
# org.gradle.console=verbose
|
||||||
|
# org.gradle.daemon.idletimeout=3600000
|
||||||
|
# '';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Home Manager can also manage your environment variables through
|
||||||
|
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
||||||
|
# shell provided by Home Manager. If you don't want to manage your shell
|
||||||
|
# through Home Manager then you have to manually source 'hm-session-vars.sh'
|
||||||
|
# located at either
|
||||||
|
#
|
||||||
|
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||||
|
#
|
||||||
|
# or
|
||||||
|
#
|
||||||
|
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
|
||||||
|
#
|
||||||
|
# or
|
||||||
|
#
|
||||||
|
# /etc/profiles/per-user/aaron/etc/profile.d/hm-session-vars.sh
|
||||||
|
#
|
||||||
|
home.sessionVariables = {
|
||||||
|
# EDITOR = "emacs";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Let Home Manager install and manage itself.
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user