diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4c2a7fb --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1651800560, + "narHash": "sha256-LUfR0/Fv8DA0uu8Uex2S1QcLiE4B5ylplbXmMs6/YoM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "538343be863cb0b9e9f1471e6dc09e0e140c7b3d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1651726670, + "narHash": "sha256-dSGdzB49SEvdOJvrQWfQYkAefewXraHIV08Vz6iDXWQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c777cdf5c564015d5f63b09cc93bef4178b19b01", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1d88089 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/master"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + + pkgs = import nixpkgs { + inherit system; + config = { allowUnfree = true; }; + }; + + lib = nixpkgs.lib; + in { + homeManagerConfigurations = { + chris = home-manager.lib.homeManagerConfiguration { + inherit system pkgs; + username = "chris"; + homeDirectory = "/home/chris"; + configuration = { + imports = [ + ./user/home.nix + ]; + }; + }; + }; + + nixosConfigurations = { + syl = lib.nixosSystem { + inherit system; + modules = [ + ./system/syl/configuration.nix + ]; + }; + }; + }; +} diff --git a/system/kaladin/configuration.nix b/system/kaladin/configuration.nix new file mode 100644 index 0000000..695e837 --- /dev/null +++ b/system/kaladin/configuration.nix @@ -0,0 +1,183 @@ +# 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 = { + extraOptions = "experimental-features = nix-command flakes"; + package = pkgs.nixFlakes; + }; + + # Use the systemd-boot EFI boot loader. + boot.kernelPackages = pkgs.linuxPackages_zen; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + nixpkgs.config.allowUnfree = true; + boot.kernelParams = [ "mem_sleep_default=deep" ]; + + networking.hostName = "syl"; # Define your hostname. + networking.networkmanager.enable = true; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Set your time zone. + time.timeZone = "America/Chicago"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.wlp170s0.useDHCP = true; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + # Set default shell to be dash for speed + environment.binsh = "${pkgs.dash}/bin/dash"; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the Plasma 5 Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + # Configure keymap in X11 + services.xserver.layout = "us"; + # services.xserver.xkbOptions = "eurosign:e"; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = [ pkgs.gutenprint pkgs.gutenprintBin pkgs.hplipWithPlugin ]; + + # Enabel fingerprint + services.fprintd.enable = true; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + }; + + # Needed for some pipewire progs + programs.dconf.enable = true; + + # Turn on flatpak + services.flatpak.enable = true; + + #NEWS!!! + # Some other things + services.thermald.enable = true; + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC="performance"; + CPU_SCALING_GOVERNOR_ON_BAT="powersave"; + START_CHARGE_THRESH_BAT1=70; + STOP_CHARGE_THRESH_BAT1=80; + }; + }; + + services.usbmuxd.enable = true; + services.fstrim.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + services.xserver.libinput.enable = true; + + programs.fish.enable = true; + programs.zsh.enable = true; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.chris = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" "input" ]; # Enable ‘sudo’ for the user. + shell = pkgs.zsh; + }; + + programs.partition-manager.enable = true; + programs.kdeconnect.enable = true; + + security.pam.services.kwallet = { + name = "kwallet"; + enableKwallet = true; + }; + security.pam.services.sddm.enableKwallet = true; + + virtualisation.waydroid.enable = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim + wget + killall + discover + lightly-qt + pinentry + pinentry-qt + unzip + unrar + p7zip + zip + gzip + usbutils + git + ark + kget + krename + kwallet-pam + plasma5Packages.kwallet + libimobiledevice + sddm-kcm + ydotool + bottles + ]; + + # EMACS + services.emacs.package = pkgs.emacsPgtkNativeComp; + nixpkgs.overlays = [ + (import (builtins.fetchTarball { + url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz; + })) + ]; + services.emacs.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.11"; # Did you read the comment? + +} + diff --git a/system/syl/hardware-configuration.nix b/system/syl/hardware-configuration.nix new file mode 100644 index 0000000..359de71 --- /dev/null +++ b/system/syl/hardware-configuration.nix @@ -0,0 +1,56 @@ +# 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" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/500ad375-8fe0-4888-8f57-ee9d5ea1fd9f"; + fsType = "btrfs"; + options = [ "subvol=root" "noatime" "nodiratime" "ssd" "compress=zstd" "space_cache" ]; + }; + + boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/5db54453-8ae9-4ba0-b381-01255ac7d7f7"; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/500ad375-8fe0-4888-8f57-ee9d5ea1fd9f"; + fsType = "btrfs"; + options = [ "subvol=home" "noatime" "nodiratime" "ssd" "compress=zstd" "space_cache" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/500ad375-8fe0-4888-8f57-ee9d5ea1fd9f"; + fsType = "btrfs"; + options = [ "subvol=nix" "noatime" "nodiratime" "ssd" "compress=zstd" "space_cache" ]; + }; + + fileSystems."/var/log" = + { device = "/dev/disk/by-uuid/500ad375-8fe0-4888-8f57-ee9d5ea1fd9f"; + fsType = "btrfs"; + options = [ "subvol=log" "noatime" "nodiratime" "ssd" "compress=zstd" "space_cache" ]; + neededForBoot = true; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E9C0-3E97"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/4f3c6d93-3be2-480c-8be8-fb9200c06b0c"; } + ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +}