flake: Migrate mashu to flakes

This commit is contained in:
PapaTutuWawa 2021-11-04 15:11:46 +01:00
parent 1d8f2f8053
commit e9b8d91559
8 changed files with 138 additions and 85 deletions

View File

@ -35,6 +35,9 @@
miku = mkSystem {
hostConfigFile = ./hosts/miku.nix;
};
mashu = mkSystem {
hostConfigFile = ./hosts/mashu.nix;
};
};
} // eachDefaultLinuxSystem (system: {
packages = let

View File

@ -1,23 +1,6 @@
{ config, lib, pkgs, ... }:
let
mkHost = (import ../modules { lib = lib; pkgs = pkgs; }).mkHost;
in mkHost config {
userName = "alexander";
hostName = "mashu";
overlays = [ "nur" "unstable" "simple" "custom" ];
hardwareImports = [
"intel"
"wifi"
"mobile"
"surface-pro6"
];
wireless = true;
wifiInterface = "wlp1s0";
programImports = [
"zsh" "git" "mpv" "tmux" "firefox" "gnome-terminal" "gnome" "i18n" "nextcloud" "xournalpp"
"distributed-build/offload.nix"
];
{
fileSystems = {
"/" = {
device = "/dev/disk/by-label/root";
@ -33,25 +16,101 @@ in mkHost config {
device = "/dev/disk/by-label/swap";
}
];
extraOptions = old: {
boot = {
kernelParams = [ "mem_sleep_default=deep" "kernel.nmi_watchdog=0" "vm.dirty_writeback_centisecs=1500" ];
extraModprobeConfig = ''
ptw = {
programs = {
mpv.enable = true;
tmux.enable = true;
zsh.enable = true;
git.enable = true;
gnome-terminal.enable = true;
firefox.enable = true;
# TODO: Nextcloud client
};
services = {
gnome.enable = true;
};
system = {
i18n.enable = true;
singleUser = "alexander";
hostName = "mashu";
#wireless = true;
offloading.offload.enable = true;
};
hardware = {
intel.enable = true;
wifi = {
enable = true;
wifiInterface = "wlp1s0";
};
mobile.enable = true;
surface.enable = true;
};
};
boot = {
kernelParams = [ "mem_sleep_default=deep" "kernel.nmi_watchdog=0" "vm.dirty_writeback_centisecs=1500" ];
extraModprobeConfig = ''
options i915 enable_fbc=1 enable_rc6=1 modeset=1
options snd_hda_intel power_save=1
options snd_ac97_codec power_save=1
options iwlwifi power_save=Y
options iwldvm force_cam=N
'';
initrd = {
availableKernelModules = [ "xhci_pci" "nvme" "usbhid" ];
kernelModules = [ "kvm-intel" ];
};
initrd = {
availableKernelModules = [ "xhci_pci" "nvme" "usbhid" ];
kernelModules = [ "kvm-intel" ];
};
};
<<<<<<< HEAD
powerManagement = {
enable = true;
cpuFreqGovernor = "powersave";
=======
services.gnome.gnome-settings-daemon.enable = true;
# TODO: phosh 0.10.2 does not grab this. Just set it.
services.logind.extraConfig = ''
HandlePowerKey=suspend
'';
services.xserver.libinput.touchpad = {
tapping = true;
disableWhileTyping = true;
};
# TODO: phosh only allows numerical PINs...
users.users.alexander.hashedPassword = lib.mkForce "$5$AkihyU/rnc$MrGVtF2d.2CbURQo2oIWdBdDz1ZLAnKum7BOxhUjh88";
# TODO: It seems like 0.10.2 does not do this by default. So, as a workaround, start some of these
# myself.
systemd.user.services = {
gsd-media = {
description = "GSD media keys handling";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.gnome.gnome-settings-daemon}/libexec/gsd-media-keys";
Restart = "always";
};
};
gsd-power = {
description = "GSD media keys handling";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.gnome.gnome-settings-daemon}/libexec/gsd-power";
Restart = "always";
};
};
};
programs.phosh = {
enable = true;
phocConfig = {
outputs = {
"eDP-1" = {
scale = 2;
};
};
};
};
}

View File

@ -36,14 +36,16 @@
ptw = {
programs = {
mpv.primaryScreen = "C27F398";
mpv = {
primaryScreen = "C27F398";
enable = true;
};
sway.enable = true;
alacritty.enable = true;
emacs.enable = true;
firefox.enable = true;
git.enable = true;
#gnome-terminal.enable = true;
mpv.enable = true;
tmux.enable = true;
waybar.enable = true;
xournalpp.enable = true;
@ -162,47 +164,41 @@
# sway
#"_JAVA_AWT_NONREPARENTING" = 1;
# Wayland
"QT_QPA_PLATFORM" = "wayland-egl";
"ECORE_EVAS_ENGINE" = "wayland-egl";
"ELM_ENGINE" = "wayland-egl";
"SDL_VIDEODRIVER" = "wayland";
};
# Wayland
"QT_QPA_PLATFORM" = "wayland-egl";
"ECORE_EVAS_ENGINE" = "wayland-egl";
"ELM_ENGINE" = "wayland-egl";
"SDL_VIDEODRIVER" = "wayland";
};
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes ca-references
'';
# TODO: Move into modules
systemd.user.services = {
scream = {
description = "Audio receiver for the Scream virtual network sound card";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
Restart = "always";
};
# TODO: Move into modules
systemd.user.services = {
scream = {
description = "Audio receiver for the Scream virtual network sound card";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
Restart = "always";
};
replaysorcery-kms = {
description = "An open-source, instant-replay solution for Linux; KMS service";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service";
Restart = "always";
};
};
replaysorcery-kms = {
description = "An open-source, instant-replay solution for Linux; KMS service";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service";
Restart = "always";
};
replaysorcery = {
description = "An open-source, instant-replay solution for Linux";
#wantedBy = [ "default.target" ];
requires = [ "replaysorcery-kms.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery";
Restart = "always";
};
};
replaysorcery = {
description = "An open-source, instant-replay solution for Linux";
#wantedBy = [ "default.target" ];
requires = [ "replaysorcery-kms.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery";
Restart = "always";
};
};
};

View File

@ -160,7 +160,7 @@ in {
enable = true;
};
} // (if wireless then {
wifiInterface = config.ptw.system.wifiInterface;
wifiInterface = config.ptw.hardware.wifi.wifiInterface;
} else {});
nix.package = pkgs.nixUnstable;

View File

@ -39,7 +39,6 @@ in inputs.nixpkgs.lib.nixosSystem {
(import ./baseSystem.nix)
(import hostConfigFile)
#(extraOptions baseConfig)
];
specialArgs = {

View File

@ -9,10 +9,6 @@
description = "The username of this single-user system";
};
wireless = lib.mkEnableOption "Enable wireless functionality";
wifiInterface = lib.mkOption {
type = lib.types.str;
description = "The wireless interface to use for various options";
};
primaryInterface = lib.mkOption {
type = lib.types.str;
description = "The primary network interface to use";

View File

@ -3,7 +3,7 @@
let
fetchurl = pkgs.fetchurl;
fetchpatch = pkgs.fetchpatch;
commit = "f69eefacf7304857f8c0ce7ac0ebf4971121da72";
commit = "821d8f0685ebad0fa2c05c7080f45eafb28ad08c";
mkPatch = name: sha256: {
name = name;
patch = fetchpatch {
@ -59,19 +59,19 @@ in {
};
boot = {
kernelPackages = pkgs.linuxPackages_5_13;
kernelPackages = pkgs.linuxPackages_5_14;
kernelPatches = [
(mkPatch "0001-surface3-oemb" "1h5f4qgrv74x8q02f29xfia9imcm6svh5gv5vb5izxx6w5i6c9fh")
#(mkPatch "0002-mwifiex" "1qn5lqhbg67j1226msiijq42zdjwmvxzyfd5q366hlczcsw7a7r2")
(mkPatch "0003-ath10k" "0zwyb1vksh6sjbwy5fp2c108m6fqzrv78cz3a296cff550ldn0fj")
(mkPatch "0004-ipts" "0ap5li17zyvba1zx4ryyyk42m00rg5ympj2n24g5ylrld0n2xc3x")
(mkPatch "0005-surface-sam-over-hid" "1vm4v84zbyiiqwby3cr7n8ffibx072rb7rhrl5hv37dsdr03gsa3")
(mkPatch "0006-surface-sam" "1fi0w9bnfnwllmypk3llc58dmfsvx34772g8c52dgi4h9wsgnbhj")
(mkPatch "0007-surface-hotplug" "0g3fkc12pc15aqq6nqk1zfp99lj1wj7cgc1n9691bp8fhqx5aj28")
(mkPatch "0008-surface-typecover" "0803nd0w5rv17kwk3y577pm22zwzpcb52ddlkanm7jrbsrhk130f")
#(mkPatch "0009-cameras" "1i5c16bx8drzagv5nkvmsyixvsz3w75lblabsmgxlh1znxsh7cj5")
(mkPatch "0010-amd-gpio" "0qibdak0ivsch0r5kxd5hhmvw7rd75xy9mmxjbcmysv8q2y9m6hn") # TODO: Maybe drop
(mkPatch "0011-amd-s0ix" "0awv32wqwkjsxs1bhg82rqq3c4ni2f9vsdm7iscilbad28ngdab8") # TODO: Maybe drop
(mkPatch "0001-surface3-oemb" "0ji3glnbaiy10kzi2zi80278vyf0pp23s7dqx8pwirbqxi6pygnp")
(mkPatch "0002-mwifiex" "0d7jpfiyb74i5fm2gdhwa5bi9kd7ff4mb75yss0lvidga10r9hmp")
(mkPatch "0003-ath10k" "0a6iwdw5wkjd24bnz32msncr1am2db36x6qpf652rx12czia8ndj")
(mkPatch "0004-ipts" "0ib7bnh4xanz5cakr50nirshhzn3rb29x9kq4m0snp38fhyaa8dv")
(mkPatch "0005-surface-sam" "19yjxgznhv65g1v6dcv6fklahi2inmf7gllbzmh6k98r3531kzjg")
(mkPatch "0006-surface-sam-over-hid" "0np7zf8328yxy9xzbipqjw014kzy0kmm67c046fmgmvniibixvs7")
(mkPatch "0007-surface-gpe" "164hhw0jh800qxmwiahw4hdsprghm760i8c6pwq89mh440wkfxnk")
(mkPatch "0008-surface-button" "0w03azjlhwdz9isjc5swlpimj48zx7jgjws6ws8xxlb37vbg4lq6")
(mkPatch "0009-surface-typecover" "0s2i13x780zmwbksv4rk1lryrv6n6mvc49ljn3zdy4d9yy10x272")
(mkPatch "0010-cameras" "0vwz609vbrracc8qm1jzm471ls4imqlilf3hh2whsb2w2npmd0kf")
(mkPatch "0011-amd-gpio" "09xjc0fl9vccz1nks6v62359digrk92svr75qz9zcvfmpyxg18z7") # TODO: Maybe drop
{
name = "surface-config";

Binary file not shown.