commit 6d3c3fb304f333ffabf376d8208f43169ebe9388 Author: Till Date: Tue May 9 22:42:40 2023 +0200 will it blend? diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..aff90be --- /dev/null +++ b/configuration.nix @@ -0,0 +1,68 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./interception-tools.nix + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Berlin"; + + sound.enable = true; + hardware.pulseaudio.enable = true; + + users.users.till = { + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + ]; + packages = with pkgs; [ + firefox + tmux + fzf + qutebrowser + neomutt + khal + khard + rstudio + R + ruby + nodejs + vdirsyncer + ]; + }; + + environment.systemPackages = with pkgs; [ + neovim + wget + pipewire + git + foot + wofi + ]; + + fonts.fonts = with pkgs; [ + jetbrains-mono + ]; + + services = { + dbus.enable = true; + openssh.enable = true; + printing.enable = true; + }; + + programs.sway.enable = true; + programs.fish.enable = true; + system.copySystemConfiguration = true; + + system.stateVersion = "22.11"; +} + diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..bc9ad93 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "First stab at a flake for my system config" + + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + outputs = { self, nixpkgs }: { + nixosConfigurations = { + romulus = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + { config, pkgs, ... }: + { + networking.hostName = "romulus"; + } + ./hardware-romulus.nix + ./configuration.nix + ]; + }; + }; + }; +} diff --git a/hardware-romulus.nix b/hardware-romulus.nix new file mode 100644 index 0000000..8307f61 --- /dev/null +++ b/hardware-romulus.nix @@ -0,0 +1,58 @@ +# 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 = [ "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/d9731b0f-57a1-42ba-b9bd-92e225df5bc2"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" ]; + }; + + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/d1bb3d19-d95f-4486-8350-2f3a5b473881"; + + fileSystems."/swap" = + { device = "/dev/disk/by-uuid/d9731b0f-57a1-42ba-b9bd-92e225df5bc2"; + fsType = "btrfs"; + options = [ "subvol=swap" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/d9731b0f-57a1-42ba-b9bd-92e225df5bc2"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/d9731b0f-57a1-42ba-b9bd-92e225df5bc2"; + fsType = "btrfs"; + options = [ "subvol=nix" "noatime" "compress=zstd" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/EB36-69BF"; + fsType = "vfat"; + }; + + swapDevices = [ { device = "/swap/swapfile"; } ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/interception-tools.nix b/interception-tools.nix new file mode 100644 index 0000000..80bc055 --- /dev/null +++ b/interception-tools.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: + +{ + environment.etc = { + "interception/dual-function-keys/capslock.yaml".text = '' + MAPPINGS: + - KEY: KEY_CAPSLOCK + TAP: KEY_ESC + HOLD: KEY_LEFTCTRL + ''; + }; + + services.interception-tools = { + enable = true; + plugins = [ pkgs.interception-tools-plugins.dual-function-keys ]; + udevmonConfig = '' + - JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c /etc/interception/dual-function-keys/capslock.yaml | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE" + DEVICE: + EVENTS: + EV_KEY: [ KEY_CAPSLOCK ] + ''; + }; +}