diff --git a/flake.lock b/flake.lock index 0261408..b5364a0 100644 --- a/flake.lock +++ b/flake.lock @@ -97,6 +97,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1740886574, + "narHash": "sha256-jN6kJ41B6jUVDTebIWeebTvrKP6YiLd1/wMej4uq4Sk=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "26a0f969549cf4d56f6e9046b9e0418b3f3b94a5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1739736696, @@ -150,6 +170,7 @@ "disko": "disko", "ghostty": "ghostty", "home-manager": "home-manager", + "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", "zen-browser": "zen-browser" } diff --git a/flake.nix b/flake.nix index 9c86e65..608ca64 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,8 @@ zen-browser.url = "github:0xc000022070/zen-browser-flake"; zen-browser.inputs.nixpkgs.follows = "nixpkgs"; ghostty.url = "github:ghostty-org/ghostty"; + nix-index-database.url = "github:nix-community/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { @@ -42,8 +44,8 @@ }; }; commonArgs = createCommonArgs system; - in { - nixosConfigurations = import ./hosts commonArgs; + in import ./hosts commonArgs // { + # nixosConfigurations = { # pickwick = nixpkgs.lib.nixosSystem { # specialArgs = {inherit inputs outputs system dots user;}; diff --git a/home/default.nix b/home/default.nix index 3f2c656..6359ae2 100644 --- a/home/default.nix +++ b/home/default.nix @@ -10,6 +10,7 @@ ./ssh ./git.nix ./gui.nix + ./latex.nix ]; programs.neovim.enable = true; @@ -23,7 +24,6 @@ tree gnumake texinfo - texlive.combined.scheme-full ]; fonts.fontconfig.enable = true; diff --git a/home/latex.nix b/home/latex.nix new file mode 100644 index 0000000..9778e5a --- /dev/null +++ b/home/latex.nix @@ -0,0 +1,21 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: +{ + options.custom = with lib; { + latex = { + enable = mkEnableOption "Enable LaTeX"; + package = mkPackageOption pkgs [ "texlive" "combined" "scheme-full" ] { }; + }; + }; + + config = lib.mkIf config.custom.latex.enable { + home.packages = with pkgs; [ + config.custom.latex.package + ]; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix index 9b3cb3b..5866d6c 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -41,7 +41,7 @@ let users.${user} = { imports = [ - # inputs.nix-index-database.hmModules.nix-index + inputs.nix-index-database.hmModules.nix-index ./${host}/home.nix ../home ]; @@ -59,5 +59,7 @@ let }; in { - pickwick = mkNixosConfiguration "pickwick" { }; + nixosConfigurations = { + pickwick = mkNixosConfiguration "pickwick" { }; + }; } diff --git a/hosts/pickwick/default.nix b/hosts/pickwick/default.nix index 7e6fd9f..e599796 100644 --- a/hosts/pickwick/default.nix +++ b/hosts/pickwick/default.nix @@ -20,31 +20,19 @@ keyd.enable = true; displaymanager.enable = true; _1password.enable = true; + audio.enable = true; + bluetooth.enable = true; }; networking.hostName = "pickwick"; time.timeZone = "America/Chicago"; users.users = { - rayandrew = { + ${user} = { initialPassword = "abc123"; isNormalUser = true; openssh.authorizedKeys.keys = []; extraGroups = ["wheel" "video" "audio" "networkmanager"]; }; }; - - # home-manager = { - # useGlobalPkgs = true; - # useUserPackages = true; - # extraSpecialArgs = { inherit inputs system dots user hm; }; - # users.rayandrew = { - # imports = [ - # ./home; - # ]; - # }; - # }; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "25.05"; } diff --git a/hosts/pickwick/home.nix b/hosts/pickwick/home.nix index d657c95..2ff3b32 100644 --- a/hosts/pickwick/home.nix +++ b/hosts/pickwick/home.nix @@ -6,6 +6,7 @@ }: { custom = { + latex.enable = true; gui = { default.enable = true; i3.enable = true; diff --git a/nixos/audio.nix b/nixos/audio.nix new file mode 100644 index 0000000..8440339 --- /dev/null +++ b/nixos/audio.nix @@ -0,0 +1,54 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + options.custom = with lib; { + audio = { + enable = mkEnableOption "Enable audio"; + }; + }; + + config = lib.mkIf config.custom.audio.enable { + environment.systemPackages = with pkgs; [ + pwvucontrol + ]; + + services.pulseaudio.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + + # disable camera to save battery + # https://reddit.com/r/linux/comments/1em8biv/psa_pipewire_has_been_halving_your_battery_life/ + wireplumber = { + enable = true; + extraConfig = { + "10-disable-camera" = { + "wireplumber.profiles" = { + main."monitor.libcamera" = "disabled"; + }; + }; + "10-bluez" = { + "monitor.bluez.properties" = { + "bluez5.enable-sbc-xq" = true; + "bluez5.enable-msbc" = true; + "bluez5.enable-hw-volume" = true; + "bluez5.roles" = [ + "hsp_hs" + "hsp_ag" + "hfp_hf" + "hfp_ag" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/nixos/bluetooth.nix b/nixos/bluetooth.nix new file mode 100644 index 0000000..b2f387f --- /dev/null +++ b/nixos/bluetooth.nix @@ -0,0 +1,21 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + options.custom = with lib; { + bluetooth = { + enable = mkEnableOption "Enable bluetooth"; + }; + }; + + config = lib.mkIf config.custom.bluetooth.enable { + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.blueman.enable = true; + }; +} diff --git a/nixos/default.nix b/nixos/default.nix index 56b4ae9..f4fa668 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -8,30 +8,12 @@ }: { imports = [ ./1password.nix + ./audio.nix + ./bluetooth.nix ./displaymanager.nix ./keyd.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 { @@ -56,7 +38,7 @@ networking.networkmanager.enable = true; programs.dconf.enable = true; - services.pulseaudio.enable = false; + services.libinput = { enable = true; touchpad = { @@ -65,48 +47,8 @@ }; }; - # bluetooth - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - services.blueman.enable = true; - - # pipewire security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - - # disable camera to save battery - # https://reddit.com/r/linux/comments/1em8biv/psa_pipewire_has_been_halving_your_battery_life/ - wireplumber = { - enable = true; - extraConfig = { - "10-disable-camera" = { - "wireplumber.profiles" = { - main."monitor.libcamera" = "disabled"; - }; - }; - "10-bluez" = { - "monitor.bluez.properties" = { - "bluez5.enable-sbc-xq" = true; - "bluez5.enable-msbc" = true; - "bluez5.enable-hw-volume" = true; - "bluez5.roles" = [ - "hsp_hs" - "hsp_ag" - "hfp_hf" - "hfp_ag" - ]; - }; - }; - }; - }; - }; + security.polkit.enable = true; services.openssh = { enable = true; @@ -122,6 +64,7 @@ environment.systemPackages = with pkgs; [ vim htop - pwvucontrol ]; + + system.stateVersion = "25.05"; } diff --git a/nixos/displaymanager.nix b/nixos/displaymanager.nix index 764a263..1bfcaf6 100644 --- a/nixos/displaymanager.nix +++ b/nixos/displaymanager.nix @@ -49,7 +49,5 @@ xserver.xkb.layout = "us"; gnome.gnome-keyring.enable = true; }; - - security.polkit.enable = true; }; }