Skip to content

Commit

Permalink
feat: stuff. i swear i'll start commiting more often now
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyowo committed Jan 31, 2023
1 parent 5d3f128 commit 8912298
Show file tree
Hide file tree
Showing 45 changed files with 1,420 additions and 1,872 deletions.
539 changes: 131 additions & 408 deletions flake.lock

Large diffs are not rendered by default.

42 changes: 15 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,34 @@
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixpkgs-rubyowo.url = "github:rubyowo/nixpkgs/catppuccin-papirus-folders";

nixpkgs.follows = "nixpkgs-rubyowo";
nixpkgs.follows = "nixpkgs-unstable";

home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};

hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay.url = "github:oxalica/rust-overlay";
hyprland.url = "github:hyprwm/Hyprland";
hyprland-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";

nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
webcord.url = "github:fufexan/webcord-flake";
nix-gaming.url = "github:fufexan/nix-gaming";

catppuccin-toolbox.url = "github:catppuccin/toolbox";
};

outputs = {
self,
nixpkgs,
home-manager,
fenix,
rust-overlay,
hyprland,
webcord,
...
} @ inputs: let
overlays = {pkgs, ...}: {
nixpkgs.overlays = with inputs;
[
(final: _: let
inherit (final) system;
in {
rubyowo = import nixpkgs-rubyowo {inherit config system;};
})
fenix.overlays.default
webcord.overlays.default
];
nixpkgs.overlays = with inputs; [
rust-overlay.overlays.default
];
};

config = {
Expand All @@ -62,6 +45,11 @@
nixosConfigurations.selene = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
{
environment.etc."nix/inputs/nixpkgs".source = nixpkgs.outPath;
nix.nixPath = ["nixpkgs=/etc/nix/inputs/nixpkgs"];
nix.registry.nixpkgs.flake = nixpkgs;
}
./hosts/selene
home-manager.nixosModules.home-manager
{
Expand Down
109 changes: 64 additions & 45 deletions hosts/selene/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
config,
pkgs,
lib,
...
}: {
imports = [./hardware.nix ../common ../../users/rei];
Expand Down Expand Up @@ -33,8 +34,8 @@
# Nix automatically detects files in the store that have identical contents, and replaces them with hard links to a single copy.
auto-optimise-store = true;

substituters = ["https://hyprland.cachix.org" "https://nix-community.cachix.org" "https://nix-gaming.cachix.org" "https://webcord.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" "webcord.cachix.org-1:l555jqOZGHd2C9+vS8ccdh8FhqnGe8L78QrHNn+EFEs="];
substituters = ["https://hyprland.cachix.org" "https://nix-community.cachix.org" "https://nix-gaming.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
};
};

Expand Down Expand Up @@ -69,24 +70,81 @@
# Add swaylock to pam.d
security.pam.services.swaylock = {};

# Doas
security.doas.enable = true;
security.sudo.enable = false;

# OpenSSH
services.openssh.enable = true;
programs.ssh = {
startAgent = true;
extraConfig = ''
AddKeysToAgent yes
'';
};

# OpenGL
hardware.opengl.enable = true;

# SeatD
systemd.services = {
seatd = {
enable = true;
description = "Seat management daemon";
script = "${lib.getExe pkgs.seatd} -g wheel";
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "1";
};
wantedBy = ["multi-user.target"];
};
};

# Docker
virtualisation.docker.enable = true;

# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [pkgs.canon-cups-ufr2];
drivers = with pkgs; [gutenprint];
browsing = true;
browsedConf = ''
BrowseDNSSDSubTypes _cups,_print
BrowseLocalProtocols all
BrowseRemoteProtocols all
CreateIPPPrinterQueues All
BrowseProtocols all
'';
};
programs.system-config-printer.enable = true;

services.avahi = {
enable = true;
openFirewall = true;
nssmdns = true;
};

hardware.printers = let
canon = "Canon_TS5100_series";
in {
ensureDefaultPrinter = canon;
ensurePrinters = [
{
name = canon;
deviceUri = "dnssd://Canon%20TS5100%20series._ipp._tcp.local/?uuid=00000000-0000-1000-8000-0018255cb515";
model = "gutenprint.${lib.versions.majorMinor (lib.getVersion pkgs.gutenprint)}://bjc-TS5000-series/expert";
description = lib.replaceStrings ["_"] [" "] canon;
location = "My Desk";
}
];
};

# Allow unfree and insecure packages. Heh insecure, like me.
# Okay i don't do that anymore (allow insecure packages) but im still leaving the comment in :^)
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-11.5.0"
];
};

# Fonts
Expand All @@ -112,44 +170,5 @@
};
};

users.users.rei = {
isNormalUser = true;
extraGroups = ["networkmanager" "wheel" "docker"];
packages = with pkgs; [];
shell = pkgs.zsh;
};

environment = {
# Add zsh to /etc/shells
shells = [pkgs.zsh];

# List packages installed in system profile (globally).
systemPackages = with pkgs; [
wget
git
home-manager
pipewire
wireplumber
pulseaudio
zsh
unzip
gnupg
];

pathsToLink = ["/share/zsh"];
};

systemd.services = {
seatd = {
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "1";
ExecStart = "${pkgs.seatd}/bin/seatd -g wheel";
};
wantedBy = ["multi-user.target"];
};
};

system.stateVersion = "22.05";
}
23 changes: 21 additions & 2 deletions users/rei/apps/bat.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
{ config, pkgs, lib, ... }:
{
xdg.configFile."bat/themes/macchiato.tmTheme".text = builtins.readFile ../confs/bat/macchiato.tmTheme;
config,
pkgs,
lib,
...
}: {
home.activation.buildBatCache = "${lib.getExe pkgs.bat} cache --build";
programs.bat = {
enable = true;
config = {
theme = "Catppuccin-mocha";
};
themes = {
Catppuccin-mocha = builtins.readFile (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "bat";
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
}
+ "/Catppuccin-mocha.tmTheme");
};
};
}
21 changes: 21 additions & 0 deletions users/rei/apps/btop.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
config,
pkgs,
...
}: {
xdg.configFile."btop/themes/catppuccin_mocha.theme".text = builtins.readFile (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "btop";
rev = "ecb8562bb6181bb9f2285c360bbafeb383249ec3";
sha256 = "sha256-ovVtupO5jWUw6cwA3xEzRe1juUB8ykfarMRVTglx3mk=";
} + "/catppuccin_mocha.theme");

programs.btop = {
enable = true;
settings = {
color_theme = "catppuccin_mocha";
vim_keys = true;
rounded_corners = true;
};
};
}
21 changes: 21 additions & 0 deletions users/rei/apps/firefox.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
config,
pkgs,
lib,
...
}: {
programs.firefox = {
enable = true;
profiles = {
ff = {
isDefault = true;
name = "ff";
path = "ff.default";
userChrome = builtins.readFile ../confs/firefox/chrome/userChrome.css;
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
};
};
};
}
6 changes: 3 additions & 3 deletions users/rei/apps/foot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
enable = true;
settings = {
main = {
include = "${config.xdg.configHome}/foot/macchiato.ini";
include = "${config.xdg.configHome}/foot/mocha.ini";
font = "FantasqueSansMono Nerd Font Mono:size=10";
font-bold = "FantasqueSansMono Nerd Font Mono:size=10:style=Bold";
font-italic = "FantasqueSansMono Nerd Font Mono:size=10:style=Italic";
Expand All @@ -17,6 +17,6 @@
mouse.hide-when-typing = "yes";
};
};
xdg.configFile."foot/macchiato.ini".text =
builtins.readFile ../confs/foot/macchiato.ini;
xdg.configFile."foot/mocha.ini".text =
builtins.readFile ../confs/foot/mocha.ini;
}
24 changes: 18 additions & 6 deletions users/rei/apps/gtk.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
{
pkgs,
config,
inputs,
...
}: {
config.gtk = {
home.packages = with pkgs; [glib]; # gsettings
xdg.systemDirs.data = let
schema = pkgs.gsettings-desktop-schemas;
in ["${schema}/share/gsettings-schemas/${schema.name}"];

gtk = {
enable = true;
theme = {
name = "Catppuccin-Macchiato-Standard-Pink-Dark";
package = pkgs.callPackage ../packages/catppuccin-gtk {};
name = "Catppuccin-Mocha-Standard-Pink-Dark";
package = pkgs.catppuccin-gtk.override {
accents = ["pink"];
variant = "mocha";
};
};
iconTheme = {
package = pkgs.rubyowo.catppuccin-papirus-folders.override {flavor = "macchiato"; accent = "pink";};
name = "Papirus";
package = inputs.nixpkgs-rubyowo.legacyPackages.${pkgs.system}.catppuccin-papirus-folders.override {
flavor = "mocha";
accent = "pink";
};
name = "Papirus-Dark";
};
font = {
name = "FantasqueSansMono Nerd Font";
Expand All @@ -32,5 +44,5 @@
};

# cursor theme
config.home.file.".icons/default".source = "${(pkgs.callPackage ../packages/catppuccin-cursors {}).macchiatoPink}/share/icons/Catppuccin-Macchiato-Pink-Cursors";
home.file.".icons/default".source = "${pkgs.catppuccin-cursors.mochaPink}/share/icons/Catppuccin-Mocha-Pink-Cursors";
}
15 changes: 11 additions & 4 deletions users/rei/apps/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
...
}: let
ocrScript = let
inherit (pkgs) grim libnotify slurp tesseract5 wl-clipboard;
inherit (pkgs) grim slurp tesseract5 wl-clipboard;
_ = lib.getExe;
in
pkgs.writeShellScriptBin "wl-ocr" ''
${_ grim} -g "$(${_ slurp})" -t ppm - | ${_ tesseract5} - - | ${wl-clipboard}/bin/wl-copy
${_ libnotify} "$(${wl-clipboard}/bin/wl-paste)"
'';
qrScript = let
inherit (pkgs) grim slurp zbar wl-clipboard;
_ = lib.getExe;
in
pkgs.writeShellScriptBin "wl-qr" ''
${_ grim} -g "$(${_ slurp})" -t ppm - | ${_ zbar} -q - | sed "s/QR-Code://" | ${wl-clipboard}/bin/wl-copy
'';
in {
home.packages = with pkgs; [
Expand All @@ -28,6 +34,7 @@ in {
imv
mpv
ocrScript
qrScript
];

wayland.windowManager.hyprland = {
Expand All @@ -37,8 +44,8 @@ in {

xdg.configFile."hypr/hyprpaper.conf".text =
builtins.readFile ../confs/hypr/hyprpaper.conf;
xdg.configFile."hypr/macchiato.conf".text =
builtins.readFile ../confs/hypr/macchiato.conf;
xdg.configFile."hypr/mocha.conf".text =
builtins.readFile ../confs/hypr/mocha.conf;
xdg.configFile."swaylock/config".text =
builtins.readFile ../confs/swaylock/config;
}
Loading

0 comments on commit 8912298

Please sign in to comment.