Compare commits

..

No commits in common. "e2e5c9c75e7cb1c7f8493b6d51bf4e6b8ac736c2" and "995ef6a85dddbb3f3058feacdbe2c24f32327e48" have entirely different histories.

16 changed files with 30 additions and 285 deletions

55
flake.lock generated
View file

@ -1,20 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -22,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724435763, "lastModified": 1723399884,
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", "rev": "086f619dd991a4d355c07837448244029fc2d9ab",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -35,34 +20,13 @@
"type": "github" "type": "github"
} }
}, },
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1724819573, "lastModified": 1723362943,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", "rev": "a58bc8ad779655e790115244571758e8de055e3d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -73,11 +37,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1725115514, "lastModified": 1723580753,
"narHash": "sha256-llfa5ShJmYH4dYAwBf8B1c1lCv1GRq385VBfq4QztLw=", "narHash": "sha256-9Zuz0QyCp+jY9vszrn4TkqpcnGKA7bM9M+da/6I0Yfs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "2a8d5d58e80863bff01f9800f8f6f8bf9c207d0a", "rev": "e36bc569a3652499909486b983ef97d319ee7271",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -89,7 +53,6 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixgl": "nixgl",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur" "nur": "nur"
} }

View file

@ -3,30 +3,20 @@
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, home-manager, nur, nixgl, ... }@inputs: outputs = { self, nixpkgs, home-manager, nur, ... }@inputs:
let let
stateVersion = "23.11"; stateVersion = "23.11";
allSystems = [
"x86_64-linux" # 64bit AMD/Intel x86
"aarch64-linux" # 64bit ARM macOS
];
forAllSystems = fn:
nixpkgs.lib.genAttrs allSystems
(system: fn { pkgs = import nixpkgs { inherit system; }; });
in { in {
devShells = forAllSystems ({ pkgs }: { # TODO: make a multiarch flake
default = pkgs.mkShell { devShells.x86_64-linux.default =
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in pkgs.mkShell {
name = "nixfiles"; name = "nixfiles";
buildInputs = [ buildInputs = [
pkgs.shellcheck pkgs.shellcheck
@ -35,8 +25,8 @@ in {
pkgs.convco pkgs.convco
pkgs.typos pkgs.typos
]; ];
}; };
});
nixosConfigurations = { nixosConfigurations = {
morty = nixpkgs.lib.nixosSystem { morty = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -84,21 +74,5 @@ in {
]; ];
}; };
}; };
homeConfigurations = {
rick = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [ nixgl.overlay ];
};
extraSpecialArgs = {
inherit stateVersion inputs;
hostname = "rick";
username = "ephase";
};
modules = [
./home-manager/default.nix
];
};
};
}; };
} }

View file

@ -1,19 +0,0 @@
{ lib, stateVersion, username, hostname, ... }:
{
home.username = "${username}";
home.homeDirectory = "/home/${username}";
home.stateVersion = stateVersion;
programs.home-manager.enable = true;
fonts.fontconfig.enable = true;
home.sessionPath = [
"$HOME/.local/bin"
];
imports = [
../nixos/includes/system/overlay.nix
../hosts/${hostname}/home-config.nix
../modules/home-manager/default.nix
]++ lib.optional (
builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix
) ../hosts/${hostname}/includes/home-manager.nix;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

View file

@ -1,55 +0,0 @@
{ ... }: {
config.modules = {
application = {
gnupg.enable = true;
zathura.enable = true;
foot.enable = true;
imv = {
enable = true;
installPackage = false;
};
};
cli = {
direnv.enable = true;
ghq.enable = true;
git.enable = true;
neovim.enable = true;
starship.enable = true;
utils.enable = true;
vifm.enable = true;
zsh.enable = true;
};
video = {
kdenlive.enable = false;
mpv.enable = true;
};
web.firefox = {
enable = true;
enableNixGL = true;
};
web.qutebrowser = {
enable = true;
enableNixGL = true;
};
web.webcord.enable = false;
gaming.lutris.enable = false;
desktop.sway = {
enable = true;
installPackage = false;
kanshi = false;
wallpapers.lockscreen = "${./files/lockscreen.png}";
wallpapers.desktop = "${./files/background.png} fill #000000";
waybar = {
laptop = true;
gpuThermal = {
enable = false;
};
cpuThermal = {
thermalZone = "2";
# hwmonPathAbs = "";
# inputFilename = "";
};
};
};
};
}

View file

@ -1,8 +0,0 @@
_:
{
wayland.windowManager.sway.config.output = {
"eDP-1" = {
scale = "1.3";
};
};
}

View file

@ -1,27 +1,15 @@
{ lib, config, pkgs, ... }: { lib, config, ... }:
with lib; with lib;
let let
cfg = config.modules.application.imv; cfg = config.modules.application.zathura;
in in
{ {
options.modules.application.imv = { options.modules.application.imv = {
enable = mkEnableOption "enable IMV image viewer"; enable = mkEnableOption "enable IMV image viewer";
installPackage = mkOption {
type = types.bool;
default = true;
description = "install Package, if false relies on distribution packages";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.imv = { programs.imv = {
enable = true; enable = true;
package =
if cfg.installPackage
then pkgs.imv
else pkgs.emptyDirectory;
}; };
xdg.mimeApps.defaultApplications = { xdg.mimeApps.defaultApplications = {
"image/*" = "imv-dir.desktop"; "image/*" = "imv-dir.desktop";

View file

@ -7,12 +7,6 @@ in
options.modules.desktop.sway = { options.modules.desktop.sway = {
enable = mkEnableOption "enable Sway Windows Manager"; enable = mkEnableOption "enable Sway Windows Manager";
installPackage = mkOption {
type = types.bool;
default = true;
description = "install Package, if false relies on distribution packages";
};
kanshi = mkOption { kanshi = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;

View file

@ -7,14 +7,6 @@ in
config = mkIf config.modules.desktop.sway.enable { config = mkIf config.modules.desktop.sway.enable {
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
# Do not install sway package on other system that NixOS
# because performance issue
package =
if cfg.installPackage
then pkgs.sway
else null;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
systemd.enable = true; systemd.enable = true;
config = { config = {
@ -69,10 +61,7 @@ in
"${mod}+Shift+q" = "kill"; "${mod}+Shift+q" = "kill";
"${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel"; "${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel";
"${mod}+Shift+c" = "reload"; "${mod}+Shift+c" = "reload";
"${mod}+Alt+l" = "${mod}+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock";
if cfg.installPackage
then "exec ${pkgs.swaylock}/bin/swaylock"
else "exec swaylock";
"${mod}+${left} focus" = "left"; "${mod}+${left} focus" = "left";
"${mod}+${down} focus" = "down"; "${mod}+${down} focus" = "down";
"${mod}+${up} focus" = "up"; "${mod}+${up} focus" = "up";

View file

@ -1,8 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let
cfg = config.modules.desktop.sway;
in
{ {
config = mkIf config.modules.desktop.sway.enable { config = mkIf config.modules.desktop.sway.enable {
services.swayidle = { services.swayidle = {
@ -10,34 +7,22 @@ in
timeouts = [ timeouts = [
{ {
timeout = 300; timeout = 300;
command = command = "${pkgs.swaylock}/bin/swaylock -f";
if cfg.installPackage
then "${pkgs.swaylock}/bin/swaylock -f"
else "swaylock -f";
} }
{ {
timeout = 600; timeout = 600;
command = ''${pkgs.sway}/bin/swaymsg "output * power off"''; command = ''${pkgs.sway}/bin/swaymsg "output * power off"'';
resumeCommand = resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * power on"'';
if cfg.installPackage
then ''${pkgs.sway}/bin/swaymsg "output * power on"''
else ''swaymsg "output * power on"'';
} }
]; ];
events = [ events = [
{ {
event = "before-sleep"; event = "before-sleep";
command = command = "${pkgs.swaylock}/bin/swaylock -f";
if cfg.installPackage
then "${pkgs.swaylock}/bin/swaylock -f"
else "swaylock -f";
} }
{ {
event = "lock"; event = "lock";
command = command = "${pkgs.swaylock}/bin/swaylock -f";
if cfg.installPackage
then "${pkgs.swaylock}/bin/swaylock -f"
else "swaylock -f";
} }
]; ];
}; };

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, ... }:
with lib; with lib;
let let
cfg = config.modules.desktop.sway; cfg = config.modules.desktop.sway;
@ -7,10 +7,6 @@ in
config = mkIf config.modules.desktop.sway.enable { config = mkIf config.modules.desktop.sway.enable {
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
package =
if cfg.installPackage
then pkgs.swaylock
else pkgs.emptyDirectory;
settings = { settings = {
image = "${cfg.wallpapers.lockscreen}"; image = "${cfg.wallpapers.lockscreen}";
scaling = "center"; scaling = "center";

View file

@ -7,12 +7,6 @@ in
{ {
options.modules.web.firefox = { options.modules.web.firefox = {
enable = mkEnableOption "enable Firefox web browser"; enable = mkEnableOption "enable Firefox web browser";
enableNixGL = mkOption {
type = types.bool;
default = false;
description = "Use NixGL to start Firefox";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.browserpass = { programs.browserpass = {
@ -26,26 +20,7 @@ in
"x-scheme-handler/about" = "firefox.desktop"; "x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop"; "x-scheme-handler/unknown" = "firefox.desktop";
}; };
xdg.desktopEntries."firefox" = mkIf cfg.enableNixGL {
name = "Firefox NixGL Powered";
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox %U";
icon = "firefox";
terminal = false;
type = "Application";
startupNotify = true;
actions = {
"new-private-window" = {
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox --private-window %U";
name = "New Private Window";
};
"new-window" = {
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox --new-window %U";
name = "New Window";
};
};
};
programs.firefox = { programs.firefox = {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped { package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
nativeMessagingHosts = [ nativeMessagingHosts = [
# Tridactyl native connector # Tridactyl native connector
@ -53,6 +28,7 @@ in
pkgs.browserpass pkgs.browserpass
]; ];
}; };
enable = true;
profiles.ephase = { profiles.ephase = {
id = 0; id = 0;
name = "ephase"; name = "ephase";

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }: { lib, config, ... }:
with lib; with lib;
let let
cfg = config.modules.web.qutebrowser; cfg = config.modules.web.qutebrowser;
@ -6,30 +6,8 @@ in
{ {
options.modules.web.qutebrowser = { options.modules.web.qutebrowser = {
enable = mkEnableOption "enable Qutebrowser web browser"; enable = mkEnableOption "enable Qutebrowser web browser";
enableNixGL = mkOption {
type = types.bool;
default = false;
description = "Use NixGL to start Qutebrowser";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
xdg.desktopEntries."org.qutebrowser.qutebrowser" = mkIf cfg.enableNixGL {
name = "QuteBrowser NixGL Powered";
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa qutebrowser %u";
icon = "qutebrowser";
terminal = false;
type = "Application";
startupNotify = true;
actions = {
"preference" = {
exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa qutebrowser \"qute://settings\"";
name = "Preferences";
};
};
};
programs.qutebrowser = { programs.qutebrowser = {
enable = true; enable = true;
loadAutoconfig = true; loadAutoconfig = true;

View file

@ -1,9 +1,9 @@
{ inputs, pkgs, ...}: { inputs, ...}:
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
qutebrowser = prev.qutebrowser.override { qutebrowser = prev.qutebrowser.override {
enableWideVine = if pkgs.system == "x86_64-linux" then true else false; enableWideVine = true;
}; };
}) })
inputs.nur.overlay inputs.nur.overlay

View file

@ -29,26 +29,10 @@ tasks:
cmds: cmds:
- doas nixos-rebuild --flake .#{{.TARGET}} switch - doas nixos-rebuild --flake .#{{.TARGET}} switch
test:*: test:*:
vars: vars:
TARGET: "{{index .MATCH 0}}" TARGET: "{{index .MATCH 0}}"
cmds: cmds:
- doas nixos-rebuild --flake .#{{.TARGET}} test - doas nixos-rebuild --flake .#{{.TARGET}} test
home:build:*:
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- home-manager build --flake .#{{.TARGET}}
home:test:*:
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- home-manager test --flake .#{{.TARGET}}
home:switch:*:
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- home-manager switch --flake .#{{.TARGET}}