Moar progress
This commit is contained in:
parent
9c5f454a1c
commit
4830f943b4
11 changed files with 219 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
secrets/
|
||||
dotfiles/zsh/.zcompdump
|
||||
dotfiles/nvim/lazy-lock.json
|
||||
result
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./persist.nix
|
||||
./disko.nix
|
||||
./packages.nix
|
||||
];
|
||||
|
||||
users.allowNoPasswordLogin = true; /* DEBUG */
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
networking = {
|
||||
|
@ -19,6 +20,7 @@
|
|||
efi.canTouchEfiVariables = true;
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "/dev/nvme0"; # [managed by install.sh] { grub device }
|
||||
efiSupport = true;
|
||||
gfxmodeEfi = "1920x1080";
|
||||
};
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
|
||||
}
|
50
hosts/vm/default.nix
Normal file
50
hosts/vm/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./disko.nix
|
||||
./packages.nix
|
||||
];
|
||||
|
||||
users.allowNoPasswordLogin = true; /* DEBUG */
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
networking = {
|
||||
hostName = "vm";
|
||||
useDHCP = lib.mkDefault true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "/dev/nvme0n1"; # [managed by install.sh] { grub device }
|
||||
gfxmodeEfi = "1920x1080";
|
||||
};
|
||||
};
|
||||
|
||||
tmp.useTmpfs = true;
|
||||
kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
||||
supportedFilesystems = [ "btfs" "vfat" "xfs" ];
|
||||
initrd = {
|
||||
availableKernelModules = [ "nvme" "xhci_pci" "ahci"
|
||||
"usbhid" "usb_storage" "sd_mod" ];
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
fstrim.enable = true;
|
||||
btrfs.autoScrub.enable = true;
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
# These are system specific. If you have any additional drives that are not
|
||||
# your root device you can add and mount them here. Added nofail so that you can
|
||||
# install this configuration on a device without it exploding when you don't have
|
||||
# these specific partitions.
|
||||
};
|
||||
|
||||
system.stateVersion = "24.11"; # [managed by install.sh] { state version }
|
||||
}
|
||||
|
64
hosts/vm/disko.nix
Normal file
64
hosts/vm/disko.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
master = {
|
||||
type = "disk";
|
||||
device = ""; # [managed by install.sh] { device }
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
priority = 1;
|
||||
name = "efi";
|
||||
start = "1M";
|
||||
end = "1024M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" "-L nixos" ];
|
||||
postCreateHook = ''
|
||||
TMP_MNT=$(mktemp -d)
|
||||
MNT_PART="" # [managed by install.sh] { root partition }
|
||||
mount "$MNT_PART" "$TMP_MNT" -o subvol=/
|
||||
trap 'umount "$TMP_MNT"; rm -rf "$TMP_MNT"' EXIT
|
||||
btrfs subvolume snapshot "$TMP_MNT/root" "$TMP_MNT/blank"
|
||||
'';
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"noatime"
|
||||
"compress=zstd"
|
||||
];
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [
|
||||
"noatime"
|
||||
"compress=zstd"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
14
hosts/vm/packages.nix
Normal file
14
hosts/vm/packages.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = let
|
||||
modules = ../../modules/nixos;
|
||||
in [
|
||||
"${modules}/core"
|
||||
"${modules}/hardware/audio"
|
||||
"${modules}/hardware/gpu/graphics.nix"
|
||||
"${modules}/multimedia"
|
||||
"${modules}/desktop/gnome"
|
||||
];
|
||||
}
|
||||
|
72
install.sh
72
install.sh
|
@ -6,3 +6,75 @@
|
|||
#
|
||||
# This script aims to automate the deployment of my configuration
|
||||
# on a new machine.
|
||||
|
||||
args_ensure_extra_arg() {
|
||||
if [ -z "$2" ] || [ "$(echo "$2" | cut -c 1-1)" = "-" ]; then
|
||||
>&2 echo "Argument '$1' requires an extra argument. Run --help for more info."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
args_ensure_is_set() {
|
||||
if [ -z "$2" ]; then
|
||||
>&2 echo "Argument '$1' is required to be set. Please consult the README or run again with --help."
|
||||
fi
|
||||
}
|
||||
|
||||
args() {
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
"-h" | "--help")
|
||||
echo ""
|
||||
echo "$0 - Installation script for my NixOS configuration"
|
||||
echo ""
|
||||
echo "arguments:"
|
||||
echo " -h|--help Print this and exit"
|
||||
echo " -d|--device [device] (required) The device you want to install NixOS on to"
|
||||
echo " -o|--host [hostname] (required) The host from ./hosts you want to install"
|
||||
echo ""
|
||||
echo "origin: https://github.com/c4em/dotnix"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
|
||||
"-d" | "--device")
|
||||
args_ensure_extra_arg "$@"
|
||||
if [ ! -b "$2" ]; then
|
||||
>&2 echo "'$2' is not a valid block device. Make sure you selected the right drive"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOTNIX_INSTALL_DEVICE="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
"-o" | "--host")
|
||||
args_ensure_extra_arg "$@"
|
||||
|
||||
if [ ! -f "./hosts/$2" ]; then
|
||||
>&2 echo "Invalid hostname '$2'. Make sure it exists in ./hosts"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOTNIX_HOSTNAME="$2"
|
||||
shift 2
|
||||
;;
|
||||
|
||||
*)
|
||||
>&2 echo "Unrecognized argument '$1'. Run with --help to view accepted arguments."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
args_ensure_is_set "--device" "$DOTNIX_INSTALL_DEVICE"
|
||||
args_ensure_is_set "--host" "$DOTNIX_HOSTNAME"
|
||||
}
|
||||
|
||||
main () {
|
||||
args "$@"
|
||||
}
|
||||
|
||||
set -e
|
||||
main "$@"
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
};
|
||||
|
||||
home.persistence."/nix/persist/home/caem" = {
|
||||
allowOther = true;
|
||||
directories = [
|
||||
"documents"
|
||||
"download"
|
||||
|
|
|
@ -3,11 +3,7 @@
|
|||
{
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"GoMono"
|
||||
];
|
||||
})
|
||||
nerdfonts
|
||||
ipafont
|
||||
noto-fonts-emoji
|
||||
cantarell-fonts
|
||||
|
|
9
modules/nixos/hardware/gpu/graphics.nix
Normal file
9
modules/nixos/hardware/gpu/graphics.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
{
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,12 +1,11 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
imports = [
|
||||
../graphics.nix
|
||||
];
|
||||
|
||||
hardware = {
|
||||
nvidia = {
|
||||
open = true;
|
||||
modesetting.enable = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue