first attempt

This commit is contained in:
cy 2024-12-12 23:35:10 -05:00
parent 57b6d529a4
commit 263d66e190
8 changed files with 202 additions and 163 deletions

7
nix/flake.lock generated
View file

@ -40,15 +40,16 @@
"locked": {
"lastModified": 1733759999,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"owner": "NixOS",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"type": "github"
},
"original": {
"id": "nixpkgs",
"owner": "nixos",
"ref": "nixos-unstable",
"type": "indirect"
"repo": "nixpkgs",
"type": "github"
}
},
"root": {

View file

@ -2,7 +2,7 @@
description = "cy's flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
@ -14,28 +14,39 @@
master.url = "github:NixOS/nixpkgs/2ab79c44f98391b6ee2edfb11f4c7a57ce1404b5";
};
outputs = { self, nixpkgs, sops-nix, home-manager, ... }@inputs:
let
outputs = {
self,
nixpkgs,
sops-nix,
home-manager,
...
}@inputs: let
lib = nixpkgs.lib;
system = "x86_64-linux";
inherit (self) outputs;
in
{
packages = import ./pkgs nixpkgs.legacyPackages.${system};
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
nixosConfigurations = {
ytnix = lib.nixosSystem {
specialArgs = { inherit inputs; };
specialArgs = { inherit inputs outputs; };
modules = [
./configuration.nix
./nixos/configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.yt = import ./home.nix;
};
}
];
};
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
homeConfigurations = {
"yt@ytnix" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home-manager/home.nix
];
};
};
};
}

132
nix/home-manager/home.nix Normal file
View file

@ -0,0 +1,132 @@
{
config,
pkgs,
lib,
inputs,
outputs,
...
}: {
home = {
username = "yt";
homeDirectory = "/home/yt";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
systemd.user.startServices = "sd-switch";
nixpkgs = {
config = {
allowUnfree = true;
chromium = {
enableWideVine = true;
commandLineArgs = "--ozone-platform-hint=wayland --enable-features=WebUIDarkMode";
};
};
};
qt = {
enable = true;
platformTheme.name = "gtk";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
gtk = {
enable = true;
cursorTheme = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern";
};
theme = {
package = pkgs.adw-gtk3;
name = "adw-gtk3-dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
};
home.sessionVariables = {
ANKI_WAYLAND = "1";
};
programs.git = {
enable = true;
userName = "cy";
userEmail = "hi@cything.io";
delta.enable = true;
};
programs.neovim.enable = true;
home.packages = with pkgs; [
firefox
inputs.master.legacyPackages.${system}.ungoogled-chromium
# ungoogled-chromium
librewolf
bitwarden-desktop
bitwarden-cli
aerc
delta
fzf
zoxide
eza
fastfetch
discord
nwg-look
element-desktop-wayland
kdePackages.gwenview
kdePackages.okular
kdePackages.qtwayland
mpv
yt-dlp
signal-desktop
cosign
azure-cli
pavucontrol
btop
stockfish
cutechess
grim
slurp
rofi-wayland
rofimoji
cliphist
jq
bash-language-server
duckdb
sqlite
usbutils
llvmPackages_19.clang-tools
ghc
zola
calibre
tor-browser
wtype
bat
yarn
rclone
go
rustc
cargo
clang_19
rust-analyzer
clippy
pwgen
lua-language-server
gnumake
foot
minisign
unzip
obsidian
lm_sensors
sshfs
nextcloud-client
python312Packages.python-lsp-server
gopls
(callPackage ../pkgs/anki-bin.nix {})
];
}

View file

@ -1,42 +0,0 @@
{ config, pkgs, ... }:
{
home.username = "yt";
home.homeDirectory = "/home/yt";
home.stateVersion = "24.05";
programs.home-manager.enable = true;
qt = {
enable = true;
platformTheme.name = "gtk";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
gtk = {
enable = true;
cursorTheme = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern";
};
theme = {
package = pkgs.adw-gtk3;
name = "adw-gtk3-dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
};
home.sessionVariables = {
ANKI_WAYLAND = "1";
};
programs.git = {
enable = true;
userName = "cy";
userEmail = "hi@cything.io";
delta.enable = true;
};
}

View file

@ -1,12 +1,43 @@
{ config, lib, pkgs, inputs, ... }:
{
imports =
[
./hardware-configuration.nix
];
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
./hardware-configuration.nix
];
sops.defaultSopsFile = ./secrets/secrets.yaml;
nixpkgs = {
config = {
allowUnfree = true;
};
};
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
flake-registry = "";
};
channel.enable = false;
optimise = {
automatic = true;
dates = [ "03:45" ];
};
gc = {
automatic = true;
dates = "19:00";
persistent = true;
options = "--delete-older-than 60d";
};
};
sops.defaultSopsFile = ../secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/root/.config/sops/age/keys.txt";
sops.secrets = {
@ -79,78 +110,6 @@
isNormalUser = true;
extraGroups = [ "wheel" "libvirtd" "docker" ];
shell = pkgs.zsh;
packages = with pkgs; [
firefox
inputs.master.legacyPackages.${system}.ungoogled-chromium
# ungoogled-chromium
librewolf
bitwarden-desktop
bitwarden-cli
aerc
delta
fzf
zoxide
eza
fastfetch
discord
nwg-look
element-desktop-wayland
kdePackages.gwenview
kdePackages.okular
kdePackages.qtwayland
mpv
yt-dlp
signal-desktop
cosign
azure-cli
pavucontrol
btop
stockfish
cutechess
grim
slurp
rofi-wayland
rofimoji
cliphist
jq
bash-language-server
duckdb
sqlite
usbutils
llvmPackages_19.clang-tools
ghc
zola
calibre
tor-browser
wtype
bat
yarn
rclone
go
rustc
cargo
clang_19
rust-analyzer
clippy
pwgen
lua-language-server
gnumake
foot
minisign
unzip
obsidian
lm_sensors
activitywatch
aw-watcher-window-wayland
aw-qt
aw-watcher-afk
sshfs
nextcloud-client
python312Packages.python-lsp-server
gopls
(callPackage ./anki-bin.nix { })
];
};
environment.systemPackages = with pkgs; [
@ -206,13 +165,6 @@
fonts.packages = with pkgs; [
nerd-fonts.roboto-mono
];
nixpkgs.config = {
allowUnfree = true;
chromium = {
enableWideVine = true;
commandLineArgs = "--ozone-platform-hint=wayland --enable-features=WebUIDarkMode";
};
};
hardware.enableAllFirmware = true;
hardware.bluetooth = {
@ -221,8 +173,6 @@
};
services.blueman.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
programs.sway.enable = true;
services.borgbackup.jobs.ytnixRsync = {
@ -323,15 +273,6 @@
};
};
nix.registry.nixpkgs.flake = inputs.nixpkgs;
nix.gc = {
automatic = true;
dates = "19:00";
persistent = true;
options = "--delete-older-than 60d";
};
services.usbmuxd.enable = true;
programs.nix-ld.enable = true;
programs.evolution.enable = true;
@ -349,13 +290,6 @@
wlr.enable = true;
};
nix.optimise = {
automatic = true;
dates = [ "03:45" ];
};
nix.settings.auto-optimise-store = true;
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [

3
nix/pkgs/default.nix Normal file
View file

@ -0,0 +1,3 @@
pkgs: {
anki-bin = pkgs.callPackage ./anki-bin.nix { };
}