From 5d377f70c085adbab3762b7cb3fc5a9eb9b7263f Mon Sep 17 00:00:00 2001 From: Cameron Reed Date: Sun, 27 Aug 2023 17:14:35 -0600 Subject: [PATCH] initial commit --- bootloader.nix | 17 ++++++++++++++++ configuration.nix | 37 +++++++++++++++++++++++++++++++++++ filesystems.nix | 9 +++++++++ locale.nix | 19 ++++++++++++++++++ networking.nix | 22 +++++++++++++++++++++ packages.nix | 43 +++++++++++++++++++++++++++++++++++++++++ printing.nix | 7 +++++++ sound.nix | 23 ++++++++++++++++++++++ time.nix | 5 +++++ users/cameron.nix | 30 ++++++++++++++++++++++++++++ users/configuration.nix | 11 +++++++++++ xserver.nix | 22 +++++++++++++++++++++ 12 files changed, 245 insertions(+) create mode 100644 bootloader.nix create mode 100644 configuration.nix create mode 100644 filesystems.nix create mode 100644 locale.nix create mode 100644 networking.nix create mode 100644 packages.nix create mode 100644 printing.nix create mode 100644 sound.nix create mode 100644 time.nix create mode 100644 users/cameron.nix create mode 100644 users/configuration.nix create mode 100644 xserver.nix diff --git a/bootloader.nix b/bootloader.nix new file mode 100644 index 0000000..b2a09d2 --- /dev/null +++ b/bootloader.nix @@ -0,0 +1,17 @@ +{ ... }: + +{ + boot.loader = { + efi.canTouchEfiVariables = true; + + systemd-boot = { + enable = true; + editor = false; + configurationLimit = 5; + extraInstallCommands = '' + sed -i 's/^version Generation \([0-9]\+\).*$/version Generation \1/' /boot/loader/entries/nixos-generation-* + sed -i 's/^default .*$/default 00-arch.conf/' /boot/loader/loader.conf + ''; + }; + }; +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..e83961c --- /dev/null +++ b/configuration.nix @@ -0,0 +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 + + ./bootloader.nix + ./filesystems.nix + ./time.nix + ./networking.nix + ./locale.nix + ./xserver.nix + ./printing.nix + ./sound.nix + ./packages.nix + + # User configuration + ./users/configuration.nix + ]; + + + # 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 = "23.05"; # Did you read the comment? + + # system.autoUpgrade.enable = true; + # system.autoUpgrade.allowReboot = false; +} diff --git a/filesystems.nix b/filesystems.nix new file mode 100644 index 0000000..354534d --- /dev/null +++ b/filesystems.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + fileSystems."/home" = { + # Disable checking /home partition with fsck + # Arch has a newer version than Nix, so it errors + noCheck = true; + }; +} diff --git a/locale.nix b/locale.nix new file mode 100644 index 0000000..c13b44d --- /dev/null +++ b/locale.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; +} diff --git a/networking.nix b/networking.nix new file mode 100644 index 0000000..7aad756 --- /dev/null +++ b/networking.nix @@ -0,0 +1,22 @@ +{ ... }: + +{ + networking = { + hostName = "nixos"; + + networkmanager = { + enable = true; + }; + + firewall = { + allowedTCPPortRanges = [ + # GSConnect + { from = 1714; to = 1764; } + ]; + allowedUDPPortRanges = [ + # GSConnect + { from = 1714; to = 1764; } + ]; + }; + }; +} diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..1ea065e --- /dev/null +++ b/packages.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: + +{ + programs = { + zsh.enable = true; + vim.defaultEditor = true; + + sway = { + enable = true; + + extraPackages = with pkgs; [ + swaylock + swayidle + dmenu + wmenu + i3status + brightnessctl + wob + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + vim + wget + kitty + ranger + firefox + gnome.gnome-tweaks + ]; + + environment.gnome.excludePackages = with pkgs; [ + gnome-tour + gnome-console + epiphany + gnome.geary + ]; + + environment.shells = with pkgs; [ bash zsh ]; + + xdg.portal.wlr.enable = true; + nixpkgs.config.allowUnfree = true; +} diff --git a/printing.nix b/printing.nix new file mode 100644 index 0000000..341912b --- /dev/null +++ b/printing.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + services.printing = { + enable = true; + }; +} diff --git a/sound.nix b/sound.nix new file mode 100644 index 0000000..2f976aa --- /dev/null +++ b/sound.nix @@ -0,0 +1,23 @@ +{ ... }: + +{ + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + + services.pipewire = { + enable = true; + + alsa = { + enable = true; + support32Bit = true; + }; + + pulse.enable = true; + + # jack.enable = true + + + wireplumber.enable = true; + }; +} diff --git a/time.nix b/time.nix new file mode 100644 index 0000000..df656db --- /dev/null +++ b/time.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + time.timeZone = "America/Denver"; +} diff --git a/users/cameron.nix b/users/cameron.nix new file mode 100644 index 0000000..c07369e --- /dev/null +++ b/users/cameron.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +{ + users = { + groups.cameron.gid = 1000; + + users.cameron = { + description = "Cameron"; + isNormalUser = true; + + uid = 1000; + group = "cameron"; + extraGroups = [ "networkmanager" "wheel" ]; + + home = "/home/cameron-nix"; + createHome = true; + + shell = pkgs.zsh; + packages = (with pkgs; [ + direnv + nix-direnv + bibata-cursors + bibata-cursors-translucent + ]) ++ (with pkgs.gnomeExtensions; [ + gsconnect + dock-from-dash + ]); + }; + }; +} diff --git a/users/configuration.nix b/users/configuration.nix new file mode 100644 index 0000000..92abd5a --- /dev/null +++ b/users/configuration.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + users = { + defaultUserShell = pkgs.bash; + }; + + imports = [ + ./cameron.nix + ]; +} diff --git a/xserver.nix b/xserver.nix new file mode 100644 index 0000000..178e010 --- /dev/null +++ b/xserver.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: + +{ + services.xserver = { + # Enable X11. GDM won't launch without it + enable = true; + + layout = "us"; + libinput = { + touchpad = { + tapping = true; + }; + }; + + # Enable GNOME and its display manager, GDM + desktopManager.gnome.enable = true; + displayManager.gdm.enable = true; + + # I don't need xterm + excludePackages = [ pkgs.xterm ]; + }; +}