diff --git a/configuration.nix b/configuration.nix index 30c0868..dead29a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -6,14 +6,15 @@ { imports = - [ # Include the results of the hardware scan. + [ + # Include the results of the hardware scan. ./hardware-configuration.nix ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nixpkgs.config.allowUnfree = true; - hardware.system76.enableAll = true; + nixpkgs.config.allowUnfree = true; + hardware.system76.enableAll = true; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; @@ -22,7 +23,7 @@ networking.hostName = "nixos76"; # Define your hostname. # Pick only one of the below networking options. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. # Set your time zone. time.timeZone = "America/New_York"; @@ -43,26 +44,26 @@ environment.etc.crypttab = { enable = true; text = '' -# /etc/crypttab: mappings for encrypted partitions. -# -# Each mapped device will be created in /dev/mapper, so your /etc/fstab -# should use the /dev/mapper/ paths for encrypted devices. -# -# See crypttab(5) for the supported syntax. -# -# NOTE: Do not list your root (/) partition here, it must be set up -# beforehand by the initramfs (/etc/mkinitcpio.conf). The same applies -# to encrypted swap, which should be set up with mkinitcpio-openswap -# for resume support. -# -# -# luks-d515fd8a-a021-4a1e-bd21-5793c3c3a771 UUID=d515fd8a-a021-4a1e-bd21-5793c3c3a771 /crypto_keyfile.bin luks -externaldrive UUID=b9e3979c-9362-4242-a835-6dd702dfb0ee /etc/externalHD_keyfile.bin luks - ''; + # /etc/crypttab: mappings for encrypted partitions. + # + # Each mapped device will be created in /dev/mapper, so your /etc/fstab + # should use the /dev/mapper/ paths for encrypted devices. + # + # See crypttab(5) for the supported syntax. + # + # NOTE: Do not list your root (/) partition here, it must be set up + # beforehand by the initramfs (/etc/mkinitcpio.conf). The same applies + # to encrypted swap, which should be set up with mkinitcpio-openswap + # for resume support. + # + # + # luks-d515fd8a-a021-4a1e-bd21-5793c3c3a771 UUID=d515fd8a-a021-4a1e-bd21-5793c3c3a771 /crypto_keyfile.bin luks + externaldrive UUID=b9e3979c-9362-4242-a835-6dd702dfb0ee /etc/externalHD_keyfile.bin luks + ''; }; fileSystems."/media/external".device = "/dev/mapper/externaldrive"; - + # Enable the X11 windowing system. services.xserver.enable = true; @@ -75,11 +76,11 @@ externaldrive UUID=b9e3979c-9362-4242-a835-6dd702dfb0ee /etc/externalHD_keyfile. hardware.opengl.setLdLibraryPath = true; hardware.opengl.extraPackages = [ pkgs.intel-media-driver - ]; + ]; hardware.opengl.extraPackages32 = [ pkgs.intel-media-driver pkgs.pkgsi686Linux.libva - ]; + ]; # Configure keymap in X11 # services.xserver.layout = "us"; @@ -105,59 +106,44 @@ externaldrive UUID=b9e3979c-9362-4242-a835-6dd702dfb0ee /etc/externalHD_keyfile. # Define a user account. Don't forget to set a password with ‘passwd’. users.users.alex = { isNormalUser = true; - home = "/home/alex"; extraGroups = [ "wheel" "networkmanager" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - firefox - keepassxc - nextcloud-client - discord - vscode - wineWowPackages.unstableFull - winetricks - mpv - git - lutris - steam - spotify - ]; }; home-manager.users.alex = import ./home.nix; fileSystems."/home/alex/Documents" = { - device = "/media/external/Documents"; - options = [ "bind" ]; + device = "/media/external/Documents"; + options = [ "bind" ]; }; fileSystems."/home/alex/Games" = { - device = "/media/external/Games"; - options = [ "bind" ]; + device = "/media/external/Games"; + options = [ "bind" ]; }; fileSystems."/home/alex/Git" = { - device = "/media/external/Git"; - options = [ "bind" ]; + device = "/media/external/Git"; + options = [ "bind" ]; }; fileSystems."/home/alex/Lutris" = { - device = "/media/external/Lutris"; - options = [ "bind" ]; + device = "/media/external/Lutris"; + options = [ "bind" ]; }; fileSystems."/home/alex/Music" = { - device = "/media/external/Music"; - options = [ "bind" ]; + device = "/media/external/Music"; + options = [ "bind" ]; }; fileSystems."/home/alex/Pictures" = { - device = "/media/external/Pictures"; - options = [ "bind" ]; + device = "/media/external/Pictures"; + options = [ "bind" ]; }; fileSystems."/home/alex/Videos" = { - device = "/media/external/Videos"; - options = [ "bind" ]; + device = "/media/external/Videos"; + options = [ "bind" ]; }; # List packages installed in system profile. To search, run: @@ -168,7 +154,6 @@ externaldrive UUID=b9e3979c-9362-4242-a835-6dd702dfb0ee /etc/externalHD_keyfile. font-manager lshw mesa_22_3 - nixfmt pavucontrol unzip vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. @@ -209,6 +194,5 @@ externaldrive UUID=b9e3979c-9362-4242-a835-6dd702dfb0ee /etc/externalHD_keyfile. # 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? - } diff --git a/home.nix b/home.nix index 1e3438d..895791c 100644 --- a/home.nix +++ b/home.nix @@ -7,8 +7,21 @@ home.homeDirectory = "/home/alex"; # Packages that should be installed to the user profile. - home.packages = [ - pkgs.nixpkgs-fmt + home.packages = with pkgs; [ + discord + firefox + git + keepassxc + lutris + mpv + nextcloud-client + nixpkgs-fmt + spotify + steam + vscode + winetricks + wineWowPackages.unstableFull + yt-dlp ]; # This value determines the Home Manager release that your diff --git a/quick-switch.sh b/quick-switch.sh index 514a193..5c02f45 100755 --- a/quick-switch.sh +++ b/quick-switch.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash +set -euo pipefail if [ -z "$(git status --porcelain)" ] then git push --force-with-lease + rev=$(git rev-parse HEAD) sudo nixos-rebuild switch \ - --show-trace \ - --flake "git+https://git.atauno.com/atau/nixos-config.git" + --flake "git+https://git.atauno.com/atau/nixos-config.git?ref=master&rev=$rev" else echo "Git working directory is unclean, please commit changes" exit 1