diff --git a/flake.lock b/flake.lock index 4447c82..32ecd43 100644 --- a/flake.lock +++ b/flake.lock @@ -299,6 +299,25 @@ "type": "github" } }, + "home-manager-cosmic": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1728250817, + "narHash": "sha256-OVHpUlNxHpQUe2Waav/MR+Z7fm6ft/w8SxWlvXv+AdU=", + "owner": "tristanbeedell", + "repo": "home-manager", + "rev": "ce770a3e442b2105852a6f5f79f3645b4c64505c", + "type": "github" + }, + "original": { + "owner": "tristanbeedell", + "ref": "cosmic", + "repo": "home-manager", + "type": "github" + } + }, "home-manager_2": { "inputs": { "nixpkgs": [ @@ -387,17 +406,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727122398, - "narHash": "sha256-o8VBeCWHBxGd4kVMceIayf5GApqTavJbTa44Xcg5Rrk=", + "lastModified": 1722185531, + "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "30439d93eb8b19861ccbe3e581abf97bdc91b093", + "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "NixOS", "ref": "nixos-unstable", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-stable": { @@ -433,6 +453,21 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1727122398, + "narHash": "sha256-o8VBeCWHBxGd4kVMceIayf5GApqTavJbTa44Xcg5Rrk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "30439d93eb8b19861ccbe3e581abf97bdc91b093", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1725534445, "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", @@ -448,7 +483,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1725194671, "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", @@ -517,8 +552,9 @@ "root": { "inputs": { "home-manager": "home-manager", + "home-manager-cosmic": "home-manager-cosmic", "nixos-cosmic": "nixos-cosmic", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixvim": "nixvim", "sops-nix": "sops-nix", "stylix": "stylix" @@ -547,7 +583,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { @@ -574,7 +610,7 @@ "flake-utils": "flake-utils_2", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "systems": "systems_2", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", diff --git a/flake.nix b/flake.nix index e6b7f52..c655bec 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager-cosmic.url = "github:tristanbeedell/home-manager/cosmic"; stylix.url = "github:danth/stylix"; sops-nix.url = "github:Mic92/sops-nix"; nixos-cosmic = { @@ -32,8 +33,6 @@ zenix = mkConf { nixos-modules = [ ./hardware/zenix.nix - # (auto-login "Hyprland") - # ./nixos/programs/hyprland.nix ./nixos/programs/cosmic.nix ./nixos/programs/gamer.nix ./nixos/programs/personal.nix @@ -43,7 +42,6 @@ ./home/programs/graphical.nix ./home/programs/gamer.nix ./home/programs/personal/. - ./home/programs/xr.nix ]; }; diff --git a/hardware/zenix.nix b/hardware/zenix.nix index 8702d8b..22ea30e 100644 --- a/hardware/zenix.nix +++ b/hardware/zenix.nix @@ -25,6 +25,13 @@ in { options = ["subvol=@" "compress=zstd" "autodefrag"]; }; + fileSystems."/nix" = { + device = "/dev/disk/by-label/nix"; + fsType = "f2fs"; + neededForBoot = true; + options = ["noatime"]; + }; + boot.initrd.postDeviceCommands = pkgs.lib.mkBefore (decrypt { keydevice = "/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0"; keypartname = "usbkey"; @@ -57,7 +64,7 @@ in { networking.useDHCP = lib.mkDefault true; # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; - networking.networkmanager.insertNameservers = ["1.1.1.1" "1.0.0.1"]; + networking.networkmanager.appendNameservers = ["1.1.1.1" "1.0.0.1"]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/home/desktop/cosmic/default.nix b/home/desktop/cosmic/default.nix new file mode 100644 index 0000000..c8281d5 --- /dev/null +++ b/home/desktop/cosmic/default.nix @@ -0,0 +1,85 @@ +{ + pkgs, + config, + ... +}: let + inherit (config.lib.cosmic) Actions; +in { + programs.cosmic = { + enable = true; + input.asDefaults = true; + input.binds = { + # Navigation + Super. "h" = Actions.Focus "Left"; + Super. "l" = Actions.Focus "Right"; + Super. "j" = Actions.Focus "Down"; + Super. "k" = Actions.Focus "Up"; + Super.Shift. "h" = Actions.Move "Left"; + Super.Shift. "l" = Actions.Move "Right"; + Super.Shift. "j" = Actions.Move "Down"; + Super.Shift. "k" = Actions.Move "Up"; + Super. "1" = Actions.Workspace 1; + Super. "2" = Actions.Workspace 2; + Super. "3" = Actions.Workspace 3; + Super. "4" = Actions.Workspace 4; + Super. "5" = Actions.Workspace 5; + Super.Shift. "1" = Actions.MoveToWorkspace 1; + Super.Shift. "2" = Actions.MoveToWorkspace 2; + Super.Shift. "3" = Actions.MoveToWorkspace 3; + Super.Shift. "4" = Actions.MoveToWorkspace 4; + Super.Shift. "5" = Actions.MoveToWorkspace 5; + Super. "Space" = Actions.ToggleWindowFloating; + Super. "f" = Actions.Maximize; + Super. "m" = Actions.Minimize; + Super.Shift. "x" = Actions.Close; + Super.Shift. "v" = Actions.ToggleStacking; + Super.Shift. "y" = Actions.ToggleSticky; + # System + Super. "d" = Actions.Spawn config.programs.menu.drunCommand; + Super. "Return" = Actions.Spawn pkgs.alacritty; + Super. "o" = Actions.System "HomeFolder"; + Super.Shift. "s" = Actions.System "Screenshot"; + }; + background = { + displays = { + all = { + source = ../../../images/nier2.jpg; + }; + }; + }; + panels = { + "Bar" = { + applets = { + start = [ + "com.system76.CosmicAppletWorkspaces" + ]; + center = [ + "com.system76.CosmicAppletMinimize" + ]; + end = [ + "com.system76.CosmicAppletTime" + "com.system76.CosmicAppletTiling" + "com.system76.CosmicAppletAudio" + "com.system76.CosmicAppletNetwork" + "com.system76.CosmicAppletNotifications" + "com.system76.CosmicAppletStatusArea" + "com.system76.CosmicAppletPower" + ]; + }; + options = { + size = "XS"; + border_radius = 0; + }; + }; + }; + settings = { + "com.system76.CosmicComp".options = { + autotile = true; + active_hint = true; + focus_follows_cursor = true; + focus_follows_cursor_delay = 0; + cursor_follows_focus = true; + }; + }; + }; +} diff --git a/home/programs/git.nix b/home/programs/git.nix index 0829c05..73deb04 100644 --- a/home/programs/git.nix +++ b/home/programs/git.nix @@ -9,11 +9,18 @@ bclone = "!sh ${pkgs.writeShellScriptBin "bare-clone" '' url=$1 basename=''${url##*/} - name=''${2:-''${basename%.*}} + if [[ $2 == -* ]] + then + opts=''${@:2} + name=''${basename%.*} + else + opts=''${@:3} + name=''${2:-''${basename%.*}} + fi mkdir "$name" - git clone --bare "$url" "$name/.bare" || { + git clone --bare "$url" "$name/.bare" $opts || { rm -r "$name" exit 1 } @@ -23,7 +30,7 @@ git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git fetch origin + git fetch origin $opts ''}/bin/bare-clone"; }; difftastic = { diff --git a/home/programs/graphical.nix b/home/programs/graphical.nix index a398bec..9dc9f03 100644 --- a/home/programs/graphical.nix +++ b/home/programs/graphical.nix @@ -9,11 +9,10 @@ # system selectdefaultapplication easyeffects - pavucontrol + pwvucontrol helvum # tools - obs-studio inkscape libsForQt5.okular gimp @@ -31,6 +30,14 @@ bitwarden ]; + programs.obs-studio = { + enable = true; + plugins = [ + pkgs.obs-studio-plugins.wlrobs + pkgs.obs-studio-plugins.obs-pipewire-audio-capture + ]; + }; + xdg.mimeApps.defaultApplications = { "application/pdf" = "sioyek.desktop"; }; @@ -46,6 +53,4 @@ "file:///home/tristan/Downloads" ]; }; - - programs.librewolf.enable = true; } diff --git a/home/programs/lf/default.nix b/home/programs/lf/default.nix index d63dc3b..a0b3a17 100644 --- a/home/programs/lf/default.nix +++ b/home/programs/lf/default.nix @@ -37,6 +37,7 @@ in { R = "drag"; "" = ":rename"; "" = "open-with"; + "" = ":reload"; }; programs.lf.extraConfig = '' set sixel true diff --git a/home/workstation.nix b/home/workstation.nix index 7241379..43aeaf6 100644 --- a/home/workstation.nix +++ b/home/workstation.nix @@ -37,6 +37,7 @@ programs.rbw.settings.pinentry = pkgs.pinentry-gnome3; + # https://docs.pipewire.org/page_module_raop_discover.html xdg.configFile."pipewire/pipewire.conf.d/raop-discover.conf".text = '' context.modules = [ { @@ -45,6 +46,30 @@ } ] ''; + xdg.configFile."pipewire/pipewire.conf.d/raop-sink.conf".text = '' + context.modules = [ + { name = libpipewire-module-raop-sink + args = { + # Set the remote address to tunnel to + raop.ip = "127.0.0.1" + raop.port = 8190 + raop.name = "my-raop-device" + raop.hostname = "My Service" + #raop.transport = "udp" + raop.encryption.type = "RSA" + #raop.audio.codec = "PCM" + #raop.password = "****" + #audio.format = "S16" + #audio.rate = 44100 + #audio.channels = 2 + #audio.position = [ FL FR ] + stream.props = { + # extra sink properties + } + } + } + ] + ''; services.gnome-keyring.enable = true; } diff --git a/nixos/default.nix b/nixos/default.nix index 793d0d7..e0a0092 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -45,12 +45,6 @@ in { } ]; }; - networking.hosts = { - "100.65.29.110" = ["zenix"]; - "100.106.241.122" = ["alpine" "tristans.cloud"]; - "100.71.130.111" = ["fcs-tristan-nixbook"]; - "100.69.60.83" = ["google-pixel-8"]; - }; time.timeZone = lib.mkDefault "Europe/London"; @@ -59,7 +53,10 @@ in { useXkbConfig = true; }; - services.avahi.enable = true; + services.avahi = { + enable = true; + nssmdns4 = true; + }; i18n.defaultLocale = lib.mkDefault "en_GB.UTF-8"; diff --git a/nixos/programs/cosmic.nix b/nixos/programs/cosmic.nix index f343d5c..8028081 100644 --- a/nixos/programs/cosmic.nix +++ b/nixos/programs/cosmic.nix @@ -1,4 +1,8 @@ -{inputs, ...}: { +{ + inputs, + config, + ... +}: { imports = [ inputs.nixos-cosmic.nixosModules.default ]; @@ -8,4 +12,9 @@ }; services.desktopManager.cosmic.enable = true; services.displayManager.cosmic-greeter.enable = true; + services.system76-scheduler.enable = true; + home-manager.users.${config.user}.imports = [ + (import "${inputs.home-manager-cosmic}/modules/programs/cosmic/.") + ../../home/desktop/cosmic/. + ]; } diff --git a/nixos/programs/pipewire.nix b/nixos/programs/pipewire.nix index 57a8694..4650c3c 100644 --- a/nixos/programs/pipewire.nix +++ b/nixos/programs/pipewire.nix @@ -1,4 +1,4 @@ -{ +{pkgs, ...}: { hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { diff --git a/nixos/workstation.nix b/nixos/workstation.nix index b997b05..d358c77 100644 --- a/nixos/workstation.nix +++ b/nixos/workstation.nix @@ -13,15 +13,10 @@ hardware.opentabletdriver.enable = true; - programs.nm-applet.enable = true; - - services.printing.enable = true; - services.dbus = { enable = true; packages = [pkgs.gcr]; }; - programs.light.enable = true; programs.dconf.enable = true; hardware.bluetooth.enable = true;