From e86fcef07546ffc404a840d9aed2dd43472b8720 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 20 Aug 2024 23:00:00 -0400 Subject: [PATCH] got it working! --- flake.nix | 47 ++++++++++++++++++++--------------- modules/home/dev/default.nix | 2 +- modules/home/dv.nix | 35 +++++++++++++++++++++----- modules/home/term/default.nix | 36 +++++++++++++-------------- modules/nixos/adb.nix | 2 +- modules/nixos/console.nix | 2 +- modules/nixos/gui.nix | 5 ++++ modules/nixos/i18n.nix | 2 +- modules/nixos/users.nix | 2 ++ waves.nix | 33 ++++++++++++------------ 10 files changed, 101 insertions(+), 65 deletions(-) diff --git a/flake.nix b/flake.nix index 9279a52..a3c4aef 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,33 @@ home-manager, flake-utils, ... - } @ inputs: flake-utils.lib.eachDefaultSystem(system: let + } @ inputs: { + nixosConfigurations.waves = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit (self) outputs; + inherit inputs flake-utils; + }; + modules = [ + inputs.disko.nixosModules.default + (import ./disko.nix {device="/dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_1TB_S6WSNJ0T900943T";}) + ./waves.nix + ]; + }; + + overlays = import ./overlays {inherit inputs;}; + + homeConfigurations."dv@waves" = home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { system = "x86_64-linux"; }; + extraSpecialArgs = { + inherit (self) outputs; + inherit inputs flake-utils; + }; + + modules = [ + ./modules/home/dv.nix + ]; + }; +} // flake-utils.lib.eachDefaultSystem(system: let pkgs = nixpkgs.legacyPackages.${system}; inherit (self) outputs; in { @@ -49,25 +75,6 @@ formatter = pkgs.alejandra; - overlays = import ./overlays {inherit inputs;}; - nixosConfigurations.waves = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs flake-utils; - }; - modules = [ - inputs.disko.nixosModules.default - (import ./disko.nix {device="/dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_1TB_S6WSNJ0T900943T";}) - ./waves.nix - ]; - }; - - homeConfigurations."dv@waves" = home-manager.lib.homeManagerConfiguration { - pkgs = import nixpkgs { system = system; }; - - modules = [ - ./modules/home/dv.nix - ]; - }; }); } diff --git a/modules/home/dev/default.nix b/modules/home/dev/default.nix index 9027073..0ee7b10 100644 --- a/modules/home/dev/default.nix +++ b/modules/home/dev/default.nix @@ -1,5 +1,5 @@ {pkgs, ...}: { - import = [ + imports = [ ./git.nix ./ssh.nix ./gpg.nix diff --git a/modules/home/dv.nix b/modules/home/dv.nix index 7e16005..2c6f0b5 100644 --- a/modules/home/dv.nix +++ b/modules/home/dv.nix @@ -1,4 +1,4 @@ -{pkgs, lib, config, inputs, ...}: { +{pkgs, lib, config, inputs, outputs, ...}: { imports = [ ./services.nix ./programs.nix @@ -10,9 +10,32 @@ ./gui.nix ]; + nix = { + #package = pkgs.nix; + registry.nixpkgs.flake = inputs.nixpkgs; + gc.automatic = true; + 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 + #allowUnfree = true; + }; + }; + + nixpkgs.config = { + allowUnfree = true; + cudaSupport = true; + }; + nixpkgs.overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + ]; home = { file.".ssh/id_user.pub".text = builtins.readFile ../nixos/id_user.pub; - username = config.users.users.dv.name; + username = "dv"; homeDirectory = "/dv"; extraOutputsToInstall = ["doc" "devdoc"]; packages = [ @@ -30,7 +53,7 @@ NIX_AUTO_RUN = "1"; FLAKE = "/dv/nixos"; }; - # stateVersion = ""; <- figure out when installing WARNING: + stateVersion = "24.11"; }; nix.package = lib.mkForce pkgs.unstable.nixVersions.latest; nix.extraOptions = '' @@ -43,8 +66,8 @@ }; programs.home-manager.enable = true; programs.git.enable = true; - programs.nix-index.enable = true; - programs.nix-index.symlinkToCacheHome = true; - programs.nix-index-database.comma.enable = true; + #programs.nix-index.enable = true; + #programs.nix-index.symlinkToCacheHome = true; + #programs.nix-index-database.comma.enable = true; systemd.user.startServices = "sd-switch"; } diff --git a/modules/home/term/default.nix b/modules/home/term/default.nix index 17c5db2..dfaa34d 100644 --- a/modules/home/term/default.nix +++ b/modules/home/term/default.nix @@ -78,23 +78,23 @@ tmux = { plugins = with pkgs.tmuxPlugins; [ vim-tmux-navigator yank - { - plugin = tokyo-night-tmux; - extraConfig = '' -# tokyo night tmux config -set -g @tokyo-night-tmux_theme "night" -set -g @tokyo-night-tmux_show_datetime 0 -set -g @tokyo-night-tmux_path_format relative -set -g @tokyo-night-tmux_window_id_style digital -set -g @tokyo-night-tmux_pane_id_style hide -set -g @tokyo-night-tmux_show_git 0 - -# Undercurl fixes (tokyonight.nvim) -set -g default-terminal "${TERM}" -set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support -set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux 3.0 - ''; - } +# { +# plugin = tokyo-night-tmux; +# extraConfig = '' +## tokyo night tmux config +#set -g @tokyo-night-tmux_theme "night" +#set -g @tokyo-night-tmux_show_datetime 0 +#set -g @tokyo-night-tmux_path_format relative +#set -g @tokyo-night-tmux_window_id_style digital +#set -g @tokyo-night-tmux_pane_id_style hide +#set -g @tokyo-night-tmux_show_git 0 +# +## Undercurl fixes (tokyonight.nvim) +#set -g default-terminal "${TERM}" +#set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support +#set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux 3.0 +# ''; +# } ]; extraConfig = '' set-option -sa terminal-overrides ",xterm*:Tc" @@ -124,8 +124,8 @@ set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{25 bind c new-window -c "#{pane_current_path}" ''; }; -xdg.configFile."lf/icons".source = ./lf-icons; }; +xdg.configFile."lf/icons".source = ./lf-icons; programs.bat.enable = true; programs.eza.enable = true; programs.man.enable = true; diff --git a/modules/nixos/adb.nix b/modules/nixos/adb.nix index 01c02a1..c0cb7d0 100644 --- a/modules/nixos/adb.nix +++ b/modules/nixos/adb.nix @@ -1,3 +1,3 @@ -{}: { +{...}: { programs.adb.enable = true; } diff --git a/modules/nixos/console.nix b/modules/nixos/console.nix index 0bd1ad2..9e6fe36 100644 --- a/modules/nixos/console.nix +++ b/modules/nixos/console.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{pkgs, lib, ...}: { console = { earlySetup = true; font = "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz"; diff --git a/modules/nixos/gui.nix b/modules/nixos/gui.nix index 1d78081..e7d0bf0 100644 --- a/modules/nixos/gui.nix +++ b/modules/nixos/gui.nix @@ -1,3 +1,8 @@ { services.xserver.enable = true; + services.xserver.desktopManager = { + xterm.enable = false; + xfce.enable = true; + }; + services.xserver.displayManager.defaultSession = "xfce"; } diff --git a/modules/nixos/i18n.nix b/modules/nixos/i18n.nix index 072a698..3f8b5a8 100644 --- a/modules/nixos/i18n.nix +++ b/modules/nixos/i18n.nix @@ -1,4 +1,4 @@ -{}: { +{...}: { time.timeZone = "America/Indiana/Indianapolis"; i18n.defaultLocale = "en_US.UTF-8"; diff --git a/modules/nixos/users.nix b/modules/nixos/users.nix index c8e8189..72fa1fd 100644 --- a/modules/nixos/users.nix +++ b/modules/nixos/users.nix @@ -2,6 +2,8 @@ users.users.dv = { uid = 1337; initialPassword = "iamsonaughty."; + home = "/dv"; + createHome = true; shell = pkgs.zsh; openssh.authorizedKeys.keys = [ (builtins.readFile ./id_user.pub) diff --git a/waves.nix b/waves.nix index 9459130..22c8b83 100644 --- a/waves.nix +++ b/waves.nix @@ -5,28 +5,27 @@ pkgs, outputs, inputs, ... -}: let - modulesPath = "./modules/nixos"; -in { +}: +{ imports = [ ./waves-hardware.nix inputs.nix-gaming.nixosModules.pipewireLowLatency - "${modulesPath}/virtualisation.nix" - "${modulesPath}/kanata.nix" - "${modulesPath}/services.nix" - "${modulesPath}/localnameresolution.nix" - "${modulesPath}/syncthing.nix" - "${modulesPath}/users.nix" - "${modulesPath}/adb.nix" - "${modulesPath}/console.nix" - "${modulesPath}/fonts.nix" - "${modulesPath}/nvidia.nix" - "${modulesPath}/gui.nix" - "${modulesPath}/i18n.nix" - "${modulesPath}/zsh.nix" + ./modules/nixos/virtualisation.nix + ./modules/nixos/kanata.nix + ./modules/nixos/services.nix + ./modules/nixos/localnameresolution.nix + ./modules/nixos/syncthing.nix + ./modules/nixos/users.nix + ./modules/nixos/adb.nix + ./modules/nixos/console.nix + ./modules/nixos/fonts.nix + ./modules/nixos/nvidia.nix + ./modules/nixos/gui.nix + ./modules/nixos/i18n.nix + ./modules/nixos/zsh.nix ]; - #system.stateVersion = ""; #<- replace when have stateversion + system.stateVersion = "24.05"; nixpkgs.config = { allowUnfree = true;