diff --git a/flake.nix b/flake.nix index b1757c5..c46667c 100644 --- a/flake.nix +++ b/flake.nix @@ -4,10 +4,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager/release-26.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + home-manager.url = "github:nix-community/home-manager/release-26.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs @ { @@ -16,41 +14,22 @@ nixpkgs-unstable, home-manager, ... - }: let - system = "x86_64-linux"; - in { - nixosConfigurations = { - phostron = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ({ - config, - pkgs, - ... - }: { - nixpkgs = { - hostPlatform = system; - config.allowUnfree = true; - overlays = [ - (final: prev: { - unstable = import nixpkgs-unstable { - system = prev.stdenv.hostPlatform.system; - config.allowUnfree = true; - }; - }) - ]; - }; - }) - ./hosts/phostron/configuration.nix - ]; - }; - }; - - homeConfigurations.coyote = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - extraSpecialArgs = {inherit inputs;}; + }: { + nixosConfigurations.phostron = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs;}; modules = [ - ./users/coyote/home.nix + ./nixos/configuration.nix + ./hosts/phostron/configuration.nix + ./profiles/desktops/kde.nix + ./users/coyote/configuration.nix + home-manager.nixosModules.home-manager { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = {inherit inputs;}; + users.coyote.imports = [./users/coyote/home.nix]; + }; + } ]; }; }; diff --git a/hosts/phostron/configuration.nix b/hosts/phostron/configuration.nix index 376dc57..0125931 100644 --- a/hosts/phostron/configuration.nix +++ b/hosts/phostron/configuration.nix @@ -1,12 +1,8 @@ {...}: { - imports = [ - ./hardware-configuration.nix - ../../configuration.nix - ../../profiles/kde.nix - ../../users/coyote/configuration.nix - ]; + imports = [./hardware-configuration.nix]; system.stateVersion = "26.05"; # I hope you know what you're doing. :) + nixpkgs.hostPlatform = "x86_64-linux"; services.displayManager.sddm.settings = { Theme = { diff --git a/configuration.nix b/nixos/configuration.nix similarity index 81% rename from configuration.nix rename to nixos/configuration.nix index c7bc523..8bae027 100644 --- a/configuration.nix +++ b/nixos/configuration.nix @@ -1,13 +1,16 @@ -{pkgs, ...}: { +{ + config, + lib, + pkgs, + inputs, + ...}: { boot = { - loader = { - systemd-boot = { - enable = true; - configurationLimit = 10; - }; + loader.systemd-boot = { + enable = true; + configurationLimit = 10; efi.canTouchEfiVariables = true; - timeout = 2; }; + timeout = 2; kernelParams = [ "quiet" "rd.udev.log_level=3" @@ -31,18 +34,28 @@ pipewire = { enable = true; alsa.enable = true; - alsa.support32Bit = false; # temporarily set to 'false' to fix openblas issue + alsa.support32Bit = true; pulse.enable = true; }; }; security.rtkit.enable = true; - nix = { - settings = { - experimental-features = ["nix-command" "flakes"]; - auto-optimise-store = true; - }; + nix.settings = { + experimental-features = ["nix-command" "flakes"]; + auto-optimise-store = true; + }; + + nixpkgs = { + config.allowUnfree = true; + overlays = [ + (final: prev: { + unstable = import inputs.nixpkgs-unstable { + system = prev.stdenv.hostPlatform.system; + config.allowUnfree = true; + }; + }) + ]; }; environment = { @@ -98,7 +111,10 @@ }; nix-ld = { enable = true; - libraries = with pkgs; [fuse e2fsprogs]; + libraries = with pkgs; [ + fuse + e2fsprogs + ]; }; tmux = { enable = true; diff --git a/nixos/nixpkgs.nix b/nixos/nixpkgs.nix new file mode 100644 index 0000000..8308cfe --- /dev/null +++ b/nixos/nixpkgs.nix @@ -0,0 +1,8 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: { +} diff --git a/profiles/kde.nix b/profiles/desktops/kde.nix similarity index 100% rename from profiles/kde.nix rename to profiles/desktops/kde.nix diff --git a/users/coyote/configuration.nix b/users/coyote/configuration.nix index 5971162..b5a6dae 100644 --- a/users/coyote/configuration.nix +++ b/users/coyote/configuration.nix @@ -16,65 +16,7 @@ in { defaultUserShell = pkgs.unstable.fish; }; - environment = { - systemPackages = with pkgs; [ - # utils - ghostscript - tectonic - # lisps - chicken - guile - sbcl - unstable.racket - # devel - ast-grep - nodejs - lua - luarocks - stylua - mermaid-cli - unstable.lazygit - # LSPs - ty - nil - marksman - systemd-lsp - bash-language-server - ]; - sessionVariables.SSH_AUTH_SOCK = "/run/user/${builtins.toString USER_ID}/ssh-agent"; - }; - - programs = { - starship = { - package = pkgs.unstable.starship; - transientPrompt.enable = true; - transientPrompt.left = "starship module character"; - settings = { - "$schema" = "https://starship.rs/config-schema.json"; - "git_status" = { - ahead = ">"; - behind = "<"; - diverged = "<>"; - renamed = "r"; - deleted = "x"; - }; - character = { - success_symbol = "[λ](bold green)"; - error_symbol = "[λ](bold red)"; - }; - }; - }; - ssh.startAgent = true; - obs-studio = { - enable = true; - enableVirtualCamera = true; - plugins = with pkgs.obs-studio-plugins; [ - input-overlay - droidcam-obs - wlrobs - ]; - }; - }; + environment.sessionVariables.SSH_AUTH_SOCK = "/run/user/${builtins.toString USER_ID}/ssh-agent"; systemd.user.services.ssh-add-key = { wantedBy = ["default.target"]; @@ -89,4 +31,11 @@ in { RestartSec = 1; }; }; + + programs = { + obs-studio.enableVirtualCamera = true; + ssh.startAgent = true; + starship.transientPrompt.enable = true; + starship.transientPrompt.left = "starship module character"; + }; } diff --git a/users/coyote/home.nix b/users/coyote/home.nix index 41c06aa..f48dc4e 100644 --- a/users/coyote/home.nix +++ b/users/coyote/home.nix @@ -1,12 +1,12 @@ -{pkgs, ...}: let - programsDir = ./programs; - programsImports = map (name: programsDir + "/${name}") ( - builtins.filter - (name: builtins.match ".*\\.nix" name != null) - (builtins.attrNames (builtins.readDir programsDir)) - ); -in { - imports = programsImports; +{pkgs, ...}: { + imports = let + programsDir = ./programs; + programsImports = map (name: programsDir + "/${name}") ( + builtins.filter + (name: builtins.match ".*\\.nix" name != null) + (builtins.attrNames (builtins.readDir programsDir)) + ); + in programsImports; home = { stateVersion = "26.05"; # I hope you know what you're doing. :) @@ -36,6 +36,13 @@ in { osu-lazer-bin # emulation (unstable.bottles.override {removeWarningPopup = true;}) + # lisps + chicken + guile + sbcl + unstable.racket + # devel + unstable.lazygit ]; }; @@ -65,5 +72,30 @@ in { enable = true; package = pkgs.unstable.yt-dlp; }; + starship = { + package = pkgs.unstable.starship; + settings = { + "$schema" = "https://starship.rs/config-schema.json"; + "git_status" = { + ahead = ">"; + behind = "<"; + diverged = "<>"; + renamed = "r"; + deleted = "x"; + }; + character = { + success_symbol = "[λ](bold green)"; + error_symbol = "[λ](bold red)"; + }; + }; + }; + obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + input-overlay + droidcam-obs + wlrobs + ]; + }; }; }