Created
November 15, 2024 01:05
-
-
Save makoConstruct/ddf8ef00e57b8169397f766070483c91 to your computer and use it in GitHub Desktop.
mako's nixos config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "mako's nixos config"; | |
| inputs = { | |
| nixpkgs = { url = "github:NixOS/nixpkgs/nixos-23.11"; }; | |
| # we want some packages to be more recent | |
| nixpkgs-unstable = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; | |
| rust-overlay = { | |
| url = "github:oxalica/rust-overlay"; | |
| inputs.nixpkgs.follows = "nixpkgs-unstable"; | |
| }; | |
| home-manager = { | |
| url = "github:nix-community/home-manager/release-23.11"; | |
| # url = "github:nix-community/home-manager"; | |
| inputs.nixpkgs.follows = "nixpkgs"; | |
| }; | |
| plasma-manager = { | |
| url = "github:pjones/plasma-manager"; | |
| inputs = { | |
| nixpkgs.follows = "nixpkgs"; | |
| home-manager.follows = "home-manager"; | |
| }; | |
| }; | |
| nix-alien = { | |
| url = "github:thiagokokada/nix-alien"; | |
| }; | |
| }; | |
| outputs = inputs: | |
| let | |
| username = "mako"; | |
| system = "x86_64-linux"; | |
| forHost = hostVarOverrides: let hostVars = { | |
| plasmaConfig = {}; | |
| hardwareConfiguration = import ./hardware-configuration.nix; | |
| moreSystemConfig = []; | |
| } // hostVarOverrides; in inputs.nixpkgs.lib.nixosSystem { | |
| inherit system; | |
| modules = hostVars.moreSystemConfig ++ [ | |
| hostVars.hardwareConfiguration | |
| { | |
| hardware.opengl = { | |
| enable = true; | |
| #need this for steam (Why isn't it in steam config? (possibly because it causes grave side effects. On enamel, the system often gets into a state where a window buffer will render black half of the time)) | |
| driSupport32Bit = true; | |
| }; | |
| hardware.bluetooth.enable = true; | |
| #can you really believe this isn't enabled by default | |
| boot.supportedFilesystems = [ "ntfs" ]; | |
| networking.hostName = hostVars.hostname; | |
| time.timeZone = "Pacific/Auckland"; | |
| # Define a user account. Don't forget to set a password with ‘passwd’. (I don't know when to do that. Isn't my password a secret.) | |
| users.users.mako = { | |
| isNormalUser = true; | |
| description = "mako"; | |
| extraGroups = [ "networkmanager" "wheel" "adbusers" ]; | |
| }; | |
| programs.partition-manager.enable = true; | |
| programs.steam = { | |
| enable = true; | |
| remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play | |
| dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server | |
| gamescopeSession.enable = true; # improves compositing? | |
| }; | |
| nix.settings.experimental-features = ["nix-command" "flakes"]; | |
| # and mako didn't define or necessarily understand anything below this point | |
| # ----- | |
| # Bootloader. | |
| boot.loader.systemd-boot.enable = true; | |
| boot.loader.efi.canTouchEfiVariables = true; | |
| # networking.wireless.enable = true; # Enables wireless support via wGatrose — 05/16/2023 2:25 AM | |
| # Configure network proxy if necessary | |
| # networking.proxy.default = "http://user:password@proxy:port/"; | |
| # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; | |
| # Enable networking | |
| networking.networkmanager.enable = true; | |
| # Select internationalisation properties. | |
| i18n.defaultLocale = "en_NZ.UTF-8"; | |
| i18n.extraLocaleSettings = { | |
| LC_ADDRESS = "en_NZ.UTF-8"; | |
| LC_IDENTIFICATION = "en_NZ.UTF-8"; | |
| LC_MEASUREMENT = "en_NZ.UTF-8"; | |
| LC_MONETARY = "en_NZ.UTF-8"; | |
| LC_NAME = "en_NZ.UTF-8"; | |
| LC_NUMERIC = "en_NZ.UTF-8"; | |
| LC_PAPER = "en_NZ.UTF-8"; | |
| LC_TELEPHONE = "en_NZ.UTF-8"; | |
| LC_TIME = "en_NZ.UTF-8"; | |
| }; | |
| # Enable the X11 windowing system. | |
| services.xserver.enable = true; | |
| # Enable the KDE Plasma Desktop Environment. | |
| services.xserver.displayManager.sddm.enable = true; | |
| services.xserver.desktopManager.plasma5.enable = true; | |
| # Configure keymap in X11 | |
| services.xserver = { | |
| layout = "us"; | |
| xkbVariant = ""; | |
| }; | |
| # Enable CUPS to print documents. | |
| services.printing.enable = true; | |
| # Enable sound with pipewire. | |
| sound.enable = true; | |
| hardware.pulseaudio.enable = false; | |
| security.rtkit.enable = true; | |
| services.pipewire = { | |
| enable = true; | |
| alsa.enable = true; | |
| alsa.support32Bit = true; | |
| pulse.enable = true; | |
| # If you want to use JACK applications, uncomment this | |
| #jack.enable = true; | |
| # use the example session manager (no others are packaged yet so this is enabled by default, | |
| # no need to redefine it in your config for now) | |
| #media-session.enable = true; | |
| }; | |
| # Enable touchpad support (enabled default in most desktopManager). | |
| services.xserver.libinput.enable = true; | |
| # Enable automatic login for the user. | |
| services.xserver.displayManager.autoLogin.enable = true; | |
| services.xserver.displayManager.autoLogin.user = username; | |
| # Allow unfree packages | |
| nixpkgs.config.allowUnfree = true; | |
| # List packages installed in system profile. To search, run: | |
| # $ nix search wget | |
| # environment.systemPackages = with inputs.nixpkgs.pkgs; [ vim wget ]; | |
| # 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 = hostVars.stateVersion; # Did you read the comment? | |
| } | |
| inputs.home-manager.nixosModules.home-manager | |
| { | |
| nixpkgs.config.allowUnfree = true; | |
| home-manager = { | |
| useGlobalPkgs = true; | |
| useUserPackages = true; | |
| users.${username} = | |
| let | |
| pkgs = (import inputs.nixpkgs { | |
| inherit system; | |
| config.allowUnfree = true; | |
| }); | |
| in { | |
| imports = [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; | |
| nixpkgs.config.allowUnfree = true; | |
| home.packages = (with pkgs; | |
| [ | |
| audacity mlocate duplicacy deno findutils steam-run appimage-run baobab discord file git inkscape obs-studio tdesktop viewnior xorg.xev xorg.xkill vlc ark qbittorrent unrar killall krita cmake pkg-config kfind zip veracrypt libreoffice-qt inputs.nix-alien.packages.${system}.nix-alien ani-cli wget | |
| kdenlive python3 python311Packages.pip # needs python3 for speech recognition | |
| ] ++ | |
| # this following part concerns flutter. | |
| # I couldn't get android studio to work, I'm generally not very impressed with jetbrains and don't really want to use it so I'm going to try to thug it out with vscode, but in case you want to return to it, remember that gcc and clang aren't compatible | |
| # now trying to do it with a flake | |
| [ | |
| # gcc # this can't be installed at the same time as clang, they provide the same binaries. The idiomatic way to solve this is to use a nix-shell. | |
| # I'm going to try installing flutter the recommended way, foolish as it is | |
| # android-studio | |
| # flutter # this misses the android sdk deps, most of which got put in home for me by android-studio | |
| clang glibc ninja | |
| # I just learned that installing these doesn't do anything, they have to be summoned through a nix-shell to be visible to pkg-config https://nixos.wiki/wiki/FAQ#I_installed_a_library_but_my_compiler_is_not_finding_it._Why.3F | |
| # gtk3 gtk3.dev # deps required for flutter linux development | |
| ] | |
| ) ++ (with (import inputs.nixpkgs-unstable { | |
| inherit system; | |
| config.allowUnfree = true; | |
| overlays = [ inputs.rust-overlay.overlays.default ]; | |
| }); [ | |
| #unstable stuff that can easily be upgraded without dling the entire nixpkgs | |
| (rust-bin.selectLatestNightlyWith | |
| (toolchain: toolchain.default.override { | |
| extensions = [ "rust-src" "rust-analyzer" "clippy" "rustfmt" "rustc" "cargo" ]; | |
| targets = [ "wasm32-unknown-unknown" "x86_64-unknown-linux-gnu" ]; | |
| })) | |
| signal-desktop | |
| firefox | |
| chromium | |
| vscode | |
| # taken from the wiki, required to avoid qt conflict | |
| (vivaldi.overrideAttrs (old: { | |
| dontWrapQtApps = false; | |
| dontPatchELF = true; | |
| nativeBuildInputs = old.nativeBuildInputs ++ [kdePackages.wrapQtAppsHook];})) | |
| zed-editor | |
| element-desktop | |
| ]); | |
| home.stateVersion = hostVars.stateVersion; | |
| programs.git = { | |
| enable = true; | |
| userName = "mako"; | |
| userEmail = "marcus.yass@gmail.com"; | |
| }; | |
| }; | |
| }; | |
| } | |
| ]; | |
| }; | |
| in { | |
| nixosConfigurations = { | |
| yoga = forHost { | |
| hostname = "yoga"; | |
| stateVersion = "23.05"; | |
| # plasmaConfig = import ./plasma_config.nix; | |
| plasmaConfig = {}; | |
| moreSystemConfig = [{ | |
| services.fprintd.enable = true; | |
| boot.extraModprobeConfig = "options snd_intel_dspcfg dsp_driver=1"; | |
| services.xserver.inputClassSections = ['' | |
| Identifier "touchpad" | |
| Driver "synaptics" | |
| MatchIsTouchpad "on" | |
| Option "HorizHysteresis" "1" | |
| Option "VertHysteresis" "1" | |
| '']; | |
| }]; | |
| }; | |
| enamel = forHost { | |
| hostname = "enamel"; | |
| stateVersion = "22.11"; | |
| plasmaConfig = {}; | |
| moreSystemConfig = [{ | |
| services.xserver.videoDrivers = ["nvidia"]; | |
| boot.loader.efi.efiSysMountPoint = "boot/efi/"; | |
| }]; | |
| }; | |
| }; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment