Do some formatting and sorting

This commit is contained in:
Malte Tammena 2021-05-28 00:15:51 +02:00
parent 05440c39a2
commit f3eeba5b53
5 changed files with 189 additions and 219 deletions

View file

@ -2,23 +2,8 @@
description = "Malte Tammena's system configuration";
inputs.nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; };
inputs.nixos-hardware = {
url = "github:NixOS/nixos-hardware";
};
inputs.home-manager = {
url = "github:nix-community/home-manager/";
};
#inputs.nixpkgs-wayland = {
# url = "github:colemickens/nixpkgs-wayland";
#};
#inputs.sway = {
# url = "github:swaywm/sway";
# flake = false;
#};
#inputs.libglvnd = {
# url = "github:NVIDIA/libglvnd";
# flake = false;
#};
inputs.nixos-hardware = { url = "github:NixOS/nixos-hardware"; };
inputs.home-manager = { url = "github:nix-community/home-manager"; };
outputs = { self, nixpkgs, nixos-hardware, home-manager, ... }@inputs:
let
@ -34,30 +19,8 @@
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-ssd
nixos-hardware.nixosModules.common-pc-laptop-acpi_call
./system/hardware-configuration.nix
./system/lenovo-thinkpad-p1.nix
];
hardware.nvidia.prime = {
offload.enable = true;
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
hardware.enableRedistributableFirmware = true;
services.xserver.videoDrivers = [ "nvidia" ];
#hardware.opengl.extraPackages = with pkgs; [
# vaapiVdpau
# libvdpau-va-gl
#];
#hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [
# vaapiVdpau
# libvdpau-va-gl
#];
hardware.trackpoint.enable = lib.mkDefault true;
hardware.trackpoint.emulateWheel =
lib.mkDefault config.hardware.trackpoint.enable;
# Fingerprint reader: login and unlock with fingerprint (if you add one with `fprintd-enroll`)
services.fprintd.enable = true;
};
homeManagerConfigurations."${username}" =
@ -72,7 +35,7 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}".imports = [ ./malte/home.nix ];
nixpkgs.overlays = [
nixpkgs.overlays = [
(import ./overlays/logisim.nix)
#(import ./overlays/tdesktop.nix)
#(import ./overlays/sway.nix)
@ -93,7 +56,10 @@
nixpkgs.lib.mkIf (self ? rev) self.rev;
nixpkgs.config.allowUnfree = true;
services.dbus.packages = [ pkgs.gnome3.dconf ];
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
})
];
};

View file

@ -14,23 +14,23 @@ let
wf-recorder = "${pkgs.wf-recorder}/bin/wf-recorder";
slurp = "${pkgs.slurp}/bin/slurp -db '#000000AA' -c '#EBDBB2' -w1";
fuser = "${pkgs.psmisc}/bin/fuser";
screenshot-path = "/home/malte/Pictures/screenshots/screenshot.png";
screencast-path = "/home/malte/Videos/screencasts/screencast.mp4";
screenshot-all = ''
${grim} ${screenshot-path} && ${wl-copy} < ${screenshot-path}'';
screenshot-all =
"${grim} ${screenshot-path} && ${wl-copy} < ${screenshot-path}";
screenshot-region = ''
${grim} -g "$(${slurp})" ${screenshot-path} && ${wl-copy} < ${screenshot-path}'';
screencast-all = ''${wf-recorder} -a -f ${screencast-path}'';
screencast-region = ''${wf-recorder} -a -g "$$(${slurp})" -f ${screencast-path}'';
screencast-stop = ''killall -s SIGINT wf-recorder && ${wl-copy} < ${screencast-path}'';
screencast-path = "/home/malte/Videos/screencasts/screencast.mp4";
screencast-all = "${wf-recorder} -a -f ${screencast-path}";
screencast-region =
''${wf-recorder} -a -g "$$(${slurp})" -f ${screencast-path}'';
screencast-stop =
"killall -s SIGINT wf-recorder && ${wl-copy} < ${screencast-path}";
in {
imports = [ ./gammastep.nix ./waybar.nix ./gtk.nix ./qt.nix ./pass.nix ./mako.nix ];
imports =
[ ./gammastep.nix ./waybar.nix ./gtk.nix ./qt.nix ./pass.nix ./mako.nix ];
config = {
@ -76,29 +76,28 @@ in {
border = 2;
titlebar = true;
commands = [{
command = ''
title_format "[<span foreground='${col_red}'><b>X</b></span>] %title"'';
criteria = { shell = "xwayland"; };
}
{
command = "kill";
criteria = { app_id = "firefox"; title = "Firefox Sharing Indicator"; };
}
commands = [
{
command = ''
title_format "[<span foreground='${col_red}'><b>X</b></span>] %title"'';
criteria = { shell = "xwayland"; };
}
{
command = "kill";
criteria = {
app_id = "firefox";
title = "Firefox Sharing Indicator";
};
}
];
};
bars = [{
command = "${pkgs.waybar}/bin/waybar";
position = "top";
}];
seat = {
"*" = {
xcursor_theme = "Numix-Cursor-Light 48";
};
};
seat = { "*" = { xcursor_theme = "Numix-Cursor-Light 48"; }; };
keybindings = let
mod = config.wayland.windowManager.sway.config.modifier;
@ -127,7 +126,8 @@ in {
"XF86AudioLowerVolume" =
"exec ${pkgs.ponymix}/bin/ponymix decrease 5%";
"XF86AudioMute" = "exec ${pkgs.ponymix}/bin/ponymix toggle";
"XF86AudioMicMute" = "exec ${pkgs.ponymix}/bin/ponymix --input toggle";
"XF86AudioMicMute" =
"exec ${pkgs.ponymix}/bin/ponymix --input toggle";
# Additional menus
"${mod}+p" = "exec passmenu-bemenu";
# Screenshots
@ -150,12 +150,11 @@ in {
fonts = {
names = [ "pango:FiraCode Nerd Font" ];
size = 9.0;
size = 8.0;
};
modes = let
mod = config.wayland.windowManager.sway.config.modifier;
in {
modes = let mod = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault {
recording = {
"${mod}+Escape" = "exec ${screencast-stop}; mode default";
};
@ -224,6 +223,10 @@ in {
};
# If running from tty1 start sway
config.xdg.configFile."fish/conf.d/sway.fish".text =
"\n set TTY1 (tty)\n if test -z \"$DISPLAY\"; and test $TTY1 = '/dev/tty1'\n systemd-cat -t sway sway\n end\n ";
config.xdg.configFile."fish/conf.d/sway.fish".text = ''
set TTY1 (tty)
if test -z \"$DISPLAY\"; and test $TTY1 = '/dev/tty1'
systemd-cat -t sway sway
end
'';
}

View file

@ -1,83 +1,37 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
boot = {
# Use the latest kernel
kernelPackages = pkgs.linuxPackages_latest;
programs.steam.enable = true;
#nixpkgs.config.packageOverrides = pkgs: {
# steam = pkgs.steam.override {
# extraPkgs = pkgs: [
# pkgs.SDL2
# ];
# };
#};
hardware.enableAllFirmware = true;
hardware.opengl.enable = true;
nixpkgs.config.allowUnfree = true;
#services.xserver.enable = true;
#services.xserver.displayManager.lightdm.enable = true;
#services.xserver.desktopManager.gnome3.enable = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.supportedFilesystems = [ "btrfs" ];
boot.loader.timeout = 1;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "helix-texta"; # Define your hostname.
networking.networkmanager.enable = true;
networking.hosts = {
"2a02:810a:143f:eafc:3e97:eff:fed0:e719" = [
"tammena.rocks"
"cal.tammena.rocks"
"media.tammena.rocks"
"git.tammena.rocks"
"cloud.tammena.rocks"
];
# Use the systemd-boot EFI boot loader.
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
timeout = 1;
};
};
#networking.interfaces.wlp0s20f3.useDHCP = true;
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
];
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Define a user account. Don't forget to set a password with passwd.
users.mutableUsers = false;
users.users.malte = {
description = "Malte Tammena";
#hashedPassword = "$6$8DXcFfgB3U/Irj$e879SaKE3FQktSB3EsWT279bS5cj0TG0S2q661wP2mAMtc5vtvt.h17N2td/AxwdNjnJ8wUTzDtWdXi2eFWHZ/";
hashedPassword =
"$6$oRbRjA.EHz2$YppAvuLOQgEF5ieX7Zup2SJ9sz5nmWoXd2XeqLzfFZSNsqv.Q1czjtpDl59pfZ5G0GBit4Z9nV9gkIHrDfqrQ0";
isNormalUser = true;
extraGroups =
[ "wheel" "networkmanager" "video" "lp" ]; # Enable sudo for the user.
shell = pkgs.fish;
networking = {
hostName = "helix-texta";
# nm ftw
networkmanager.enable = true;
# Make my server known!
hosts = {
"2a02:810a:143f:eafc:3e97:eff:fed0:e719" = [
"tammena.rocks"
"cal.tammena.rocks"
"media.tammena.rocks"
"git.tammena.rocks"
"cloud.tammena.rocks"
];
};
};
services.getty.autologinUser = "malte";
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [ wget neovim qt5.qtwayland steam-run-native ];
# rtkit is optional but recommended
# Pipewire for my wayland
sound.enable = false;
security.rtkit.enable = true;
services.pipewire = {
@ -88,27 +42,59 @@
jack.enable = true;
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
users = {
# I like my users unmutable
mutableUsers = false;
# Myself
users.malte = {
description = "Malte Tammena";
#hashedPassword = "$6$8DXcFfgB3U/Irj$e879SaKE3FQktSB3EsWT279bS5cj0TG0S2q661wP2mAMtc5vtvt.h17N2td/AxwdNjnJ8wUTzDtWdXi2eFWHZ/";
hashedPassword =
"$6$oRbRjA.EHz2$YppAvuLOQgEF5ieX7Zup2SJ9sz5nmWoXd2XeqLzfFZSNsqv.Q1czjtpDl59pfZ5G0GBit4Z9nV9gkIHrDfqrQ0";
isNormalUser = true;
extraGroups =
[ "wheel" "networkmanager" "video" "lp" ];
# Yes, use the best, please
shell = pkgs.fish;
};
};
# Log me in! Fish should autostart sway then!
services.getty.autologinUser = "malte";
# Use some fonts
fonts.fonts = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
];
# Configure GPG with SSH support and enable the yubikey
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "qt";
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
services.printing.enable = true;
services.udev.packages = with pkgs; [ yubikey-personalization ];
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
programs.steam.enable = true;
#nixpkgs.config.packageOverrides = pkgs: {
# steam = pkgs.steam.override {
# extraPkgs = pkgs: [
# pkgs.SDL2
# ];
# };
#};
services.dbus.packages = [ pkgs.gnome3.dconf ];
hardware.enableAllFirmware = true;
hardware.opengl.enable = true;
environment.systemPackages = with pkgs; [ wget neovim qt5.qtwayland steam-run-native ];
services.printing.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions

View file

@ -1,60 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "nouveau" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
};
boot.initrd.luks.devices."enc".device =
"/dev/disk/by-uuid/1f1e51d6-3084-4f4d-9b4b-6caa0352f542";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" ];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" ];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=log" "compress=zstd" ];
neededForBoot = true;
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B767-2B7C";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/6948f567-03b3-4a38-b3c4-e05e0bbfbf55"; }];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
# high-resolution display
hardware.video.hidpi.enable = lib.mkDefault true;
}

View file

@ -0,0 +1,75 @@
{ config, lib, pkgs, modulesPath, ... }:
{
boot = {
initrd = {
availableKernelModules =
[ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
luks.devices."enc".device =
"/dev/disk/by-uuid/1f1e51d6-3084-4f4d-9b4b-6caa0352f542";
};
kernelModules = [ "kvm-intel" "nouveau" ];
supportedFilesystems = [ "btrfs" ];
};
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware = {
enableRedistributableFirmware = true;
# high-resolution display
video.hidpi.enable = lib.mkDefault true;
nvidia.prime = {
offload.enable = true;
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
trackpoint.enable = true;
trackpoint.emulateWheel = lib.mkDefault config.hardware.trackpoint.enable;
};
services.fprintd.enable = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/B767-2B7C";
fsType = "vfat";
};
"/home" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
};
"/nix" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" ];
};
"/persist" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=persist" "compress=zstd" ];
};
"/var/log" = {
device = "/dev/disk/by-uuid/d9fd201a-f9f5-4d6f-9706-cc698699704d";
fsType = "btrfs";
options = [ "subvol=log" "compress=zstd" ];
neededForBoot = true;
};
};
swapDevices =
[{ device = "/dev/disk/by-uuid/6948f567-03b3-4a38-b3c4-e05e0bbfbf55"; }];
}