# This is your system's configuration file. # Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) { inputs, lib, config, pkgs, system, ... }: { # You can import other NixOS modules here imports = [ # If you want to use modules from other flakes (such as nixos-hardware): # inputs.hardware.nixosModules.common-cpu-amd # inputs.hardware.nixosModules.common-ssd # You can also split up your configuration and import pieces of it here: # ./users.nix # Import your generated (nixos-generate-config) hardware configuration ./hardware-configuration.nix ]; nixpkgs = { # You can add overlays here overlays = [ # If you want to use overlays exported from other flakes: # neovim-nightly-overlay.overlays.default # Or define it inline, for example: # (final: prev: { # hi = final.hello.overrideAttrs (oldAttrs: { # patches = [ ./change-hello-to-hi.patch ]; # }); # }) ]; # Configure your nixpkgs instance config = { # Disable if you don't want unfree packages allowUnfree = true; }; }; nix = let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; in { settings = { # Enable flakes and new 'nix' command experimental-features = "nix-command flakes"; # Opinionated: disable global registry flake-registry = ""; # Workaround for https://github.com/NixOS/nix/issues/9574 nix-path = config.nix.nixPath; }; # Opinionated: disable channels channel.enable = false; # Opinionated: make flake registry and nix path match flake inputs registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs; nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; }; # System packages environment = { systemPackages = [ inputs.nixvim.packages.${pkgs.system}.default pkgs.git pkgs.pyright pkgs.python3 pkgs.gcc pkgs.nodejs_22 pkgs.cargo pkgs.gnumake pkgs.stow pkgs.wget pkgs.curl pkgs.ripgrep pkgs.nixd ]; localBinInPath = true; }; fonts.packages = with pkgs; [ noto-fonts noto-fonts-cjk noto-fonts-emoji liberation_ttf fira-code-symbols font-awesome jetbrains-mono (nerdfonts.override {fonts = ["JetBrainsMono" "FiraCode" "Iosevka" "3270" "DroidSansMono"];}) ]; # Bootloader boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; # Enable networking networking.networkmanager.enable = true; # TODO: Set your hostname networking.hostName = "cnix"; # Enable sound with pipewire. hardware = { pulseaudio.enable = false; graphics = { enable = true; }; }; security.rtkit.enable = true; programs = { hyprland = { enable = true; xwayland.enable = true; }; zsh.enable = true; }; # Time zone & Locale time.timeZone = "Europe/Stockholm"; i18n.defaultLocale = "en_US.UTF-8"; i18n.extraLocaleSettings = { LC_ADDRESS = "sv_SE.UTF-8"; LC_IDENTIFICATION = "sv_SE.UTF-8"; LC_MEASUREMENT = "sv_SE.UTF-8"; LC_MONETARY = "sv_SE.UTF-8"; LC_NAME = "sv_SE.UTF-8"; LC_NUMERIC = "sv_SE.UTF-8"; LC_PAPER = "sv_SE.UTF-8"; LC_TELEPHONE = "sv_SE.UTF-8"; LC_TIME = "sv_SE.UTF-8"; }; # Console keymap console.useXkbConfig = true; # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. users.users = { cnst = { isNormalUser = true; shell = pkgs.zsh; openssh.authorizedKeys.keys = [ # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect ]; # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) extraGroups = ["wheel" "networkmanager" "audio" "video"]; }; }; # services services = { mullvad-vpn.enable = true; mullvad-vpn.package = pkgs.mullvad-vpn; greetd = { enable = true; settings = { initial_session = { command = "${pkgs.hyprland}/bin/Hyprland"; user = "cnst"; }; default_session = { command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session"; user = "greeter"; }; }; }; openssh = { enable = true; settings = { # Opinionated: forbid root login through SSH. PermitRootLogin = "no"; # Opinionated: use keys only. # Remove if you want to SSH using passwords PasswordAuthentication = false; }; }; xserver = { enable = true; # displayManager.gdm.enable = true; desktopManager.gnome.enable = true; xkb = { extraLayouts.hhkbse = { description = "HHKBse by cnst"; languages = ["se"]; symbolsFile = /home/cnst/.nix-config/nixos/xkb/symbols/hhkbse; }; layout = "hhkbse"; # dir = "/home/cnst/.nix-config/nixos/xkb"; variant = ""; options = "lv3:rwin_switch"; }; }; 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; }; }; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "24.05"; }