mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-30 08:40:52 +02:00
feat: init gustave
This commit is contained in:
parent
7640a30665
commit
80b51a0a70
3 changed files with 71 additions and 92 deletions
|
@ -1,97 +1,46 @@
|
||||||
{ config, pkgs, ... }:
|
{ lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[
|
../../users/default.nix
|
||||||
# Include the results of the hardware scan.
|
../../users/julien.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./home-julien.nix
|
./home-julien.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Bootloader.
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
deployment.targetHost = lib.mkForce "192.168.0.126";
|
||||||
|
|
||||||
disko = import ./disko.nix;
|
disko = import ./disko.nix;
|
||||||
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
systemd.network.enable = true;
|
||||||
|
systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
networking.useNetworkd = true;
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
systemd.network.networks."10-wan" = {
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
matchConfig.Name = "ens18";
|
||||||
|
networkConfig = {
|
||||||
# Enable networking
|
# start a DHCP Client for IPv4 Addressing/Routing
|
||||||
networking.networkmanager.enable = true;
|
DHCP = "ipv4";
|
||||||
|
# accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||||
|
IPv6AcceptRA = true;
|
||||||
|
};
|
||||||
|
# make routing on this interface a dependency for network-online.target
|
||||||
|
linkConfig.RequiredForOnline = "routable";
|
||||||
|
};
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Paris";
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
# Select internationalisation properties.
|
environment.persistence."/persistent" = {
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
hideMounts = true;
|
||||||
|
files = [
|
||||||
i18n.extraLocaleSettings = {
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
LC_ADDRESS = "fr_FR.UTF-8";
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||||
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
];
|
||||||
LC_MEASUREMENT = "fr_FR.UTF-8";
|
|
||||||
LC_MONETARY = "fr_FR.UTF-8";
|
|
||||||
LC_NAME = "fr_FR.UTF-8";
|
|
||||||
LC_NUMERIC = "fr_FR.UTF-8";
|
|
||||||
LC_PAPER = "fr_FR.UTF-8";
|
|
||||||
LC_TELEPHONE = "fr_FR.UTF-8";
|
|
||||||
LC_TIME = "fr_FR.UTF-8";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configure keymap in X11
|
system.stateVersion = "23.11";
|
||||||
services.xserver = {
|
|
||||||
layout = "fr";
|
|
||||||
xkbVariant = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Configure console keymap
|
|
||||||
console.keyMap = "fr";
|
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
||||||
users.users.julien = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Julien";
|
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
|
||||||
packages = with pkgs; [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
|
||||||
# wget
|
|
||||||
];
|
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
|
||||||
# started in user sessions.
|
|
||||||
# programs.mtr.enable = true;
|
|
||||||
# programs.gnupg.agent = {
|
|
||||||
# enable = true;
|
|
||||||
# enableSSHSupport = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# List services that you want to enable:
|
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
services.openssh.enable = true;
|
|
||||||
|
|
||||||
# Open ports in the firewall.
|
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
||||||
# Or disable the firewall altogether.
|
|
||||||
# networking.firewall.enable = false;
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
disk = {
|
disk = {
|
||||||
sda = {
|
sda = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = "/dev/disk/by-diskseq/3";
|
device = "/dev/sda";
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
# unless their parent is mounted
|
# unless their parent is mounted
|
||||||
subvolumes = {
|
subvolumes = {
|
||||||
# Subvolume name is different from mountpoint
|
# Subvolume name is different from mountpoint
|
||||||
"/rootfs" = {
|
"/root" = {
|
||||||
mountpoint = "/";
|
mountpoint = "/";
|
||||||
};
|
};
|
||||||
# Subvolume name is the same as the mountpoint
|
# Subvolume name is the same as the mountpoint
|
||||||
|
@ -36,13 +36,13 @@
|
||||||
mountpoint = "/persistent";
|
mountpoint = "/persistent";
|
||||||
};
|
};
|
||||||
"/nix" = {
|
"/nix" = {
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
mountOptions = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
];
|
||||||
mountpoint = "/nix";
|
mountpoint = "/nix";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mountpoint = "/partition-root";
|
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,16 +1,46 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ lib, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||||
[
|
|
||||||
(modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"ata_piix"
|
||||||
|
"uhci_hcd"
|
||||||
|
"virtio_pci"
|
||||||
|
"virtio_scsi"
|
||||||
|
"sd_mod"
|
||||||
|
"sr_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/persistent".neededForBoot = lib.mkForce true;
|
||||||
|
|
||||||
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||||
|
mkdir /btrfs_tmp
|
||||||
|
mount /dev/disk/by-partlabel/disk-sda-root /btrfs_tmp
|
||||||
|
if [[ -e /btrfs_tmp/root ]]; then
|
||||||
|
mkdir -p /btrfs_tmp/old_roots
|
||||||
|
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||||
|
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||||
|
fi
|
||||||
|
|
||||||
|
delete_subvolume_recursively() {
|
||||||
|
IFS=$'\n'
|
||||||
|
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||||
|
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||||
|
done
|
||||||
|
btrfs subvolume delete "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
|
||||||
|
delete_subvolume_recursively "$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
btrfs subvolume create /btrfs_tmp/root
|
||||||
|
umount /btrfs_tmp
|
||||||
|
'';
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue