Merge branch 'zenix/hm-cosmic' into nixbook/cosmic

This commit is contained in:
tristan 2024-10-15 19:48:13 +01:00
commit 70e6d7ced5
12 changed files with 199 additions and 34 deletions

54
flake.lock generated
View file

@ -299,6 +299,25 @@
"type": "github" "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": { "home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -387,17 +406,18 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1727122398, "lastModified": 1722185531,
"narHash": "sha256-o8VBeCWHBxGd4kVMceIayf5GApqTavJbTa44Xcg5Rrk=", "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "30439d93eb8b19861ccbe3e581abf97bdc91b093", "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixos-unstable",
"type": "indirect" "repo": "nixpkgs",
"type": "github"
} }
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
@ -433,6 +453,21 @@
} }
}, },
"nixpkgs_2": { "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": { "locked": {
"lastModified": 1725534445, "lastModified": 1725534445,
"narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=",
@ -448,7 +483,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1725194671, "lastModified": 1725194671,
"narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=",
@ -517,8 +552,9 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-cosmic": "home-manager-cosmic",
"nixos-cosmic": "nixos-cosmic", "nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixvim": "nixvim", "nixvim": "nixvim",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"stylix": "stylix" "stylix": "stylix"
@ -547,7 +583,7 @@
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
@ -574,7 +610,7 @@
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"systems": "systems_2", "systems": "systems_2",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",

View file

@ -6,6 +6,7 @@
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager-cosmic.url = "github:tristanbeedell/home-manager/cosmic";
stylix.url = "github:danth/stylix"; stylix.url = "github:danth/stylix";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
nixos-cosmic = { nixos-cosmic = {
@ -32,8 +33,6 @@
zenix = mkConf { zenix = mkConf {
nixos-modules = [ nixos-modules = [
./hardware/zenix.nix ./hardware/zenix.nix
# (auto-login "Hyprland")
# ./nixos/programs/hyprland.nix
./nixos/programs/cosmic.nix ./nixos/programs/cosmic.nix
./nixos/programs/gamer.nix ./nixos/programs/gamer.nix
./nixos/programs/personal.nix ./nixos/programs/personal.nix
@ -43,7 +42,6 @@
./home/programs/graphical.nix ./home/programs/graphical.nix
./home/programs/gamer.nix ./home/programs/gamer.nix
./home/programs/personal/. ./home/programs/personal/.
./home/programs/xr.nix
]; ];
}; };

View file

@ -25,6 +25,13 @@ in {
options = ["subvol=@" "compress=zstd" "autodefrag"]; 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 { boot.initrd.postDeviceCommands = pkgs.lib.mkBefore (decrypt {
keydevice = "/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0"; keydevice = "/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0";
keypartname = "usbkey"; keypartname = "usbkey";
@ -57,7 +64,7 @@ in {
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.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"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -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;
};
};
};
}

View file

@ -9,11 +9,18 @@
bclone = "!sh ${pkgs.writeShellScriptBin "bare-clone" '' bclone = "!sh ${pkgs.writeShellScriptBin "bare-clone" ''
url=$1 url=$1
basename=''${url##*/} basename=''${url##*/}
name=''${2:-''${basename%.*}} if [[ $2 == -* ]]
then
opts=''${@:2}
name=''${basename%.*}
else
opts=''${@:3}
name=''${2:-''${basename%.*}}
fi
mkdir "$name" mkdir "$name"
git clone --bare "$url" "$name/.bare" || { git clone --bare "$url" "$name/.bare" $opts || {
rm -r "$name" rm -r "$name"
exit 1 exit 1
} }
@ -23,7 +30,7 @@
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin git fetch origin $opts
''}/bin/bare-clone"; ''}/bin/bare-clone";
}; };
difftastic = { difftastic = {

View file

@ -9,11 +9,10 @@
# system # system
selectdefaultapplication selectdefaultapplication
easyeffects easyeffects
pavucontrol pwvucontrol
helvum helvum
# tools # tools
obs-studio
inkscape inkscape
libsForQt5.okular libsForQt5.okular
gimp gimp
@ -31,6 +30,14 @@
bitwarden bitwarden
]; ];
programs.obs-studio = {
enable = true;
plugins = [
pkgs.obs-studio-plugins.wlrobs
pkgs.obs-studio-plugins.obs-pipewire-audio-capture
];
};
xdg.mimeApps.defaultApplications = { xdg.mimeApps.defaultApplications = {
"application/pdf" = "sioyek.desktop"; "application/pdf" = "sioyek.desktop";
}; };
@ -46,6 +53,4 @@
"file:///home/tristan/Downloads" "file:///home/tristan/Downloads"
]; ];
}; };
programs.librewolf.enable = true;
} }

View file

@ -37,6 +37,7 @@ in {
R = "drag"; R = "drag";
"<f-2>" = ":rename"; "<f-2>" = ":rename";
"<enter>" = "open-with"; "<enter>" = "open-with";
"<f-5>" = ":reload";
}; };
programs.lf.extraConfig = '' programs.lf.extraConfig = ''
set sixel true set sixel true

View file

@ -37,6 +37,7 @@
programs.rbw.settings.pinentry = pkgs.pinentry-gnome3; 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 = '' xdg.configFile."pipewire/pipewire.conf.d/raop-discover.conf".text = ''
context.modules = [ 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; services.gnome-keyring.enable = true;
} }

View file

@ -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"; time.timeZone = lib.mkDefault "Europe/London";
@ -59,7 +53,10 @@ in {
useXkbConfig = true; useXkbConfig = true;
}; };
services.avahi.enable = true; services.avahi = {
enable = true;
nssmdns4 = true;
};
i18n.defaultLocale = lib.mkDefault "en_GB.UTF-8"; i18n.defaultLocale = lib.mkDefault "en_GB.UTF-8";

View file

@ -1,4 +1,8 @@
{inputs, ...}: { {
inputs,
config,
...
}: {
imports = [ imports = [
inputs.nixos-cosmic.nixosModules.default inputs.nixos-cosmic.nixosModules.default
]; ];
@ -8,4 +12,9 @@
}; };
services.desktopManager.cosmic.enable = true; services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.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/.
];
} }

View file

@ -1,4 +1,4 @@
{ {pkgs, ...}: {
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {

View file

@ -13,15 +13,10 @@
hardware.opentabletdriver.enable = true; hardware.opentabletdriver.enable = true;
programs.nm-applet.enable = true;
services.printing.enable = true;
services.dbus = { services.dbus = {
enable = true; enable = true;
packages = [pkgs.gcr]; packages = [pkgs.gcr];
}; };
programs.light.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;