Regenerated
This commit is contained in:
+63
-18
@@ -317,7 +317,69 @@ in
|
|||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* We have a nix file that will copy anything from ./assets/copy_2_home to $HOME
|
|
||||||
|
* Let's define the core of the system
|
||||||
|
|
||||||
|
** Nix itself
|
||||||
|
|
||||||
|
** =generated/traveldroid/todo/system/nix.nix=
|
||||||
|
#+BEGIN_SRC nix :tangle generated/traveldroid/todo/system/nix.nix :noweb tangle :mkdirp yes :eval never-html
|
||||||
|
{ lib, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nix.settings = {
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
download-buffer-size = 536870912; # 512 MB
|
||||||
|
cores = 2;
|
||||||
|
max-jobs = 1;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
** User stuff
|
||||||
|
|
||||||
|
** =generated/users/henrov.nix=
|
||||||
|
This is the default user, just search and replace henrov another name if you want to change
|
||||||
|
#+BEGIN_SRC nix :tangle generated/users/henrov.nix :noweb tangle :mkdirp yes :eval never-html
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
username = "henrov";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
#################################
|
||||||
|
# NixOS system user
|
||||||
|
#################################
|
||||||
|
users.users.${username} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
home = "/home/${username}";
|
||||||
|
hashedPassword = "$6$S7iShgBxB.77CwmP$i0njK.2r3OL5UEvgZbmwZ0rnpZ4QyJcv8p9uCmJ4AiVPSMXkQkIwMLzyAOnJ0q8.tPLIp/7EquEIZeK8qbmgw/";
|
||||||
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
#################################
|
||||||
|
# Home Manager user definition
|
||||||
|
#################################
|
||||||
|
_module.args.hmUsers = {
|
||||||
|
${username} = {
|
||||||
|
# Minimal required
|
||||||
|
home.username = username;
|
||||||
|
home.homeDirectory = "/home/${username}";
|
||||||
|
home.stateVersion = "26.05";
|
||||||
|
|
||||||
|
# Add user-specific packages here
|
||||||
|
home.packages = [
|
||||||
|
];
|
||||||
|
|
||||||
|
# Add user dotfiles, session variables, etc. here if needed
|
||||||
|
home.file = {
|
||||||
|
# Example:
|
||||||
|
# ".bashrc" = { source = /path/to/bashrc; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** =generated/users/copy_2_home.nix=
|
** =generated/users/copy_2_home.nix=
|
||||||
This copies stuff to the user home-folder
|
This copies stuff to the user home-folder
|
||||||
@@ -360,20 +422,3 @@ in
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
* Let's define the core of the system
|
|
||||||
|
|
||||||
** =generated/traveldroid/todo/system/nix.nix=
|
|
||||||
#+BEGIN_SRC nix :tangle generated/traveldroid/todo/system/nix.nix :noweb tangle :mkdirp yes :eval never-html
|
|
||||||
{ lib, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nix.settings = {
|
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
download-buffer-size = 536870912; # 512 MB
|
|
||||||
cores = 2;
|
|
||||||
max-jobs = 1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#+END_SRC
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
{ pkgs, config, lib, flakeRoot, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
############################
|
|
||||||
# Bootloader (GRUB)
|
|
||||||
############################
|
|
||||||
boot.loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
efiSupport = true;
|
|
||||||
devices = [ "nodev" ]; # pas aan naar je echte EFI-device indien nodig
|
|
||||||
useOSProber = true;
|
|
||||||
timeout = 5;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Kernel / boot settings
|
|
||||||
############################
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
||||||
|
|
||||||
boot.kernelParams = [
|
|
||||||
"quiet"
|
|
||||||
"splash" # REQUIRED for Plymouth
|
|
||||||
"udev.log_level=3"
|
|
||||||
"rd.systemd.show_status=false"
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.consoleLogLevel = 0;
|
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Plymouth
|
|
||||||
############################
|
|
||||||
boot.plymouth = {
|
|
||||||
enable = true;
|
|
||||||
theme = "rings";
|
|
||||||
|
|
||||||
themePackages = [
|
|
||||||
(pkgs.adi1090x-plymouth-themes.override {
|
|
||||||
selected_themes = [ "rings" ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.initrd.systemd.enable = true;
|
|
||||||
|
|
||||||
############################
|
|
||||||
# Clean state
|
|
||||||
############################
|
|
||||||
# Remove any old theme environment.etc symlinks
|
|
||||||
#environment.etc = lib.mkForce {};
|
|
||||||
system.stateVersion = "26.05";
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
hostname,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
modulesPath,
|
|
||||||
user,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
# (modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
#../../hardware/hardware.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"xhci_pci"
|
|
||||||
"nvme"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
"rtsx_usb_sdmmc"
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-uuid/69433a14-fbaf-401b-af85-cd1bbf02b4e2";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/811D-0676";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [
|
|
||||||
"fmask=0077"
|
|
||||||
"dmask=0077"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{ device = "/dev/disk/by-uuid/b6c557c2-7682-460b-a5e7-8f6f2f429a3a"; }
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
{ lib, config, pkgs, inputs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
hostname = "traveldroid";
|
|
||||||
modulesPath = ./generated/modules/${hostname};
|
|
||||||
usersPath = ./generated/users;
|
|
||||||
|
|
||||||
# Import all host-specific modules recursively (not evaluated yet)
|
|
||||||
hostModules = inputs.import-tree modulesPath;
|
|
||||||
|
|
||||||
# Import all global users
|
|
||||||
globalUsers = inputs.import-tree usersPath;
|
|
||||||
|
|
||||||
# Collect all Home Manager user attrsets from host modules + global users
|
|
||||||
hmUsersList =
|
|
||||||
map (m: m._module.args.hmUsers or {}) (hostModules.imports ++ globalUsers.imports);
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
#################################
|
|
||||||
# Core system config
|
|
||||||
#################################
|
|
||||||
networking.hostName = traveldroid;
|
|
||||||
system.stateVersion = "26.05";
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Enable Home Manager
|
|
||||||
#################################
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Module imports
|
|
||||||
#################################
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
./boot.nix
|
|
||||||
./hardware-configuration.nix
|
|
||||||
]
|
|
||||||
++ hostModules.imports
|
|
||||||
++ globalUsers.imports;
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# Home Manager aggregation
|
|
||||||
#################################
|
|
||||||
home-manager.users = lib.mkMerge hmUsersList;
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{ lib, config, pkgs, _module, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
username = config.defaultUser or "henrov";
|
|
||||||
in {
|
|
||||||
# System packages / options
|
|
||||||
environment.systemPackages = [ pkgs.feh pkgs.waybar ];
|
|
||||||
|
|
||||||
# Home Manager contribution
|
|
||||||
_module.args.hmUsers = lib.mkIf true {
|
|
||||||
${username} = {
|
|
||||||
home.file = {
|
|
||||||
".config/waybar/config" = { source = ./waybar/config; };
|
|
||||||
".config/waybar/style.css" = { source = ./waybar/style.css; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{ lib, config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nix.settings = {
|
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
download-buffer-size = 536870912; # 512 MB
|
|
||||||
cores = 2;
|
|
||||||
max-jobs = 1;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
{ config, pkgs, lib, flakeRoot, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
username = config.users.users.defaultUser or "henrov";
|
|
||||||
homeDir = "/home/${username}";
|
|
||||||
assetPath = "${flakeRoot}/assets/copy_2_home";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = [ pkgs.rsync ];
|
|
||||||
|
|
||||||
systemd.services.copyAssets = {
|
|
||||||
description = "Copy assets to ${username}'s home directory";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
# oneshot service runs once at boot
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
|
|
||||||
# Always use /bin/sh -c for multi-line commands
|
|
||||||
serviceConfig.ExecStart = ''
|
|
||||||
/bin/sh -c '
|
|
||||||
echo "Copying assets from ${assetPath} to ${homeDir} ..."
|
|
||||||
|
|
||||||
if [ ! -d "${assetPath}" ]; then
|
|
||||||
echo "ERROR: ${assetPath} does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "${homeDir}"
|
|
||||||
chown ${username}:${username} "${homeDir}"
|
|
||||||
|
|
||||||
${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${homeDir}/"
|
|
||||||
|
|
||||||
echo "Done copying assets."
|
|
||||||
'
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user