This commit is contained in:
Lukas Wurzinger 2024-12-01 05:03:34 +01:00
parent 0968b6f955
commit 0f33c80edd
15 changed files with 139 additions and 46 deletions

View file

@ -0,0 +1,3 @@
{pkgs, ...}: {
environment.systemPackages = [pkgs.devenv];
}

View file

@ -8,7 +8,7 @@
pkgs.noto-fonts-cjk-serif
pkgs.noto-fonts-monochrome-emoji
pkgs.noto-fonts-color-emoji
(pkgs.nerdfonts.override {fonts = ["FiraCode"];})
pkgs.nerd-fonts.fira-code
];
fontconfig = {

View file

@ -1,8 +1,11 @@
{
config,
lib,
pkgs,
...
}: {
}: let
inherit (config.users) mainUser;
in {
programs.gamemode = {
enable = true;
settings = {
@ -15,4 +18,6 @@
};
};
};
users.users.${mainUser}.extraGroups = ["gamemode"];
}

View file

@ -0,0 +1,9 @@
{
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
xdg.portal.xdgOpenUsePortal = true;
}

View file

@ -3,7 +3,8 @@
bluetooth.enable = true;
xone.enable = true;
xpadneo.enable = true;
opentabletdriver.enable = true;
# TODO
# opentabletdriver.enable = true;
graphics = {
enable = true;
enable32Bit = true;

17
classes/desktop/helix.nix Normal file
View file

@ -0,0 +1,17 @@
{
inputs,
lib,
pkgs,
...
}: let
package = inputs.hxwrap.packages.${pkgs.system}.default;
in {
environment.systemPackages = [package];
environment.variables = let
exe = builtins.baseNameOf (lib.getExe package);
in {
EDITOR = exe;
VISUAL = exe;
};
}

View file

@ -1,5 +0,0 @@
{pkgs, ...}: let
package = pkgs.neovide;
in {
environment.systemPackages = [package];
}

View file

@ -1,6 +1,9 @@
{
{config, ...}: let
inherit (config.users) mainUser;
in {
services.resolved.enable = true;
# TODO
networking = {
networkmanager = {
enable = true;
@ -34,4 +37,6 @@
];
};
};
users.users.${mainUser}.extraGroups = ["networkmanager"];
}

View file

@ -1,5 +1,4 @@
{
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {

View file

@ -1,25 +0,0 @@
{
lib,
pkgs,
...
}: {
services = {
desktopManager.plasma6.enable = true;
displayManager.sddm = {
enable = true;
wayland.enable = true;
};
};
environment.systemPackages = with pkgs.kdePackages; [sddm-kcm discover kate];
programs = {
kdeconnect.enable = true;
partition-manager.enable = true;
};
xdg.portal = {
xdgOpenUsePortal = true;
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
}

View file

@ -1,10 +1,19 @@
{
services = {
printing = {
enable = true;
webInterface = true;
cups-pdf.enable = true;
};
system-config-printer.enable = true;
{pkgs, ...}: {
services.printing = {
enable = true;
webInterface = true;
cups-pdf.enable = true;
drivers = [
pkgs.gutenprint
pkgs.gutenprintBin
pkgs.hplip
pkgs.hplipWithPlugin
pkgs.postscript-lexmark
pkgs.samsung-unified-linux-driver
pkgs.splix
pkgs.brlaser
pkgs.brgenml1lpr
pkgs.cnijfilter2
];
};
}

View file

@ -16,6 +16,7 @@ in {
openssh.authorizedKeys.keys = builtins.attrValues (import ../pubkeys.nix).hosts;
};
${mainUser} = {
description = "Lukas Wurzinger";
uid = 1000;
isNormalUser = true;
hashedPasswordFile = config.age.secrets."user-${mainUser}".path;

42
disk.sh
View file

@ -2,19 +2,25 @@ set -o errexit
set -o nounset
set -o pipefail
opts=$(getopt --options r:m:b:l:c: --longoptions=root:,boot-label:,main-label: --name "$0" -- "$@")
opts=$(getopt --options r:m:b:l:c: --longoptions=root:,mapping:,boot-label:,main-label:,cryptmain-label: --name "$0" -- "$@")
eval set -- "$opts"
root=/mnt
mapping=main
bootlbl=BOOT
mainlbl=main
cryptmainlbl=cryptmain
while true; do
case "$1" in
-r | --root)
root=$2
shift 2
;;
-m | --mapping)
mapping=$2
shift 2
;;
-b | --boot-label)
bootlbl=${2^^}
shift 2
@ -23,6 +29,10 @@ while true; do
mainlbl=$2
shift 2
;;
-c | --cryptmain-label)
cryptmainlbl=$2
shift 2
;;
--)
shift
break
@ -49,10 +59,38 @@ while IFS= read -r k; do
done < <(jq '.partitiontable.partitions | keys[]' <<<"$json")
bootfs="${parts[0]}"
mainfs="${parts[1]}"
mainblkdev="${parts[1]}"
mkfs.vfat -F 32 -n "$bootlbl" -- "$bootfs" >/dev/null
while true; do
read -r -p 'Do you want your main partition to be encrypted [y/N]? ' luks
case "$luks" in
[Yy]*)
while true; do
read -r -s -p 'Enter password: ' password
printf '\n'
read -r -s -p 'Re-enter password: ' repassword
printf '\n'
if [[ "$password" == "$repassword" ]]; then
break
fi
done
cryptsetup luksFormat --batch-mode --label "$cryptmainlbl" "$mainblkdev" <<<"$password"
cryptsetup open "$mainblkdev" "$mapping" <<<"$password"
mainfs=/dev/mapper/$mapping
break
;;
'' | [Nn]*)
mainfs=$mainblkdev
break
;;
*) printf 'Please answer with yes or no\n' 1>&2 ;;
esac
done
mkfs.ext4 -q -F -L "$mainlbl" -- "$mainfs"
mkdir --parents -- "$root"
mount --options noatime -- "$mainfs" "$root"

View file

@ -97,6 +97,24 @@
"type": "github"
}
},
"hxwrap": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1730417950,
"narHash": "sha256-2Lh+av929qXmYRIZ5FONrWCUWrvDFLVID2deEZCn4ek=",
"owner": "lukaswrz",
"repo": "hxwrap",
"rev": "13f97ac98899eaa33481aa912b42cf7350d16211",
"type": "github"
},
"original": {
"owner": "lukaswrz",
"repo": "hxwrap",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1703013332,
@ -126,6 +144,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1730200266,
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1732837521,
"narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=",
@ -146,7 +180,8 @@
"agenix": "agenix",
"flake-parts": "flake-parts",
"hardware": "hardware",
"nixpkgs": "nixpkgs_2"
"hxwrap": "hxwrap",
"nixpkgs": "nixpkgs_3"
}
},
"systems": {

View file

@ -6,6 +6,7 @@
flake-parts.url = "github:hercules-ci/flake-parts";
hardware.url = "github:NixOS/nixos-hardware";
agenix.url = "github:ryantm/agenix";
hxwrap.url = "github:lukaswrz/hxwrap";
};
outputs = {