Compare commits

...

14 commits

Author SHA1 Message Date
e2e5c9c75e chore: bump packages version 2024-08-31 18:16:54 +02:00
5a852c55b1 fix(home-manager): use mkIf to create desktop entries 2024-08-30 23:45:48 +02:00
6f3a124bc5 feat(home-manager): install qutebrowser with NixGL
Work on non NixOS system
2024-08-30 23:11:29 +02:00
db6386ebc0 feat(taskfile): add build target for home-manager 2024-08-30 21:22:17 +02:00
3d36ef0261 feat(home-manager): add nixgl 2024-08-30 21:22:02 +02:00
cf8a838191 fix(home-manager): avoid imv problem on non-NixOS install
There is not access to hardware acceleration when install nix above traditonnal distribution
2024-08-26 22:28:02 +02:00
db84a305dc fix: activate fontconfig to avoid problem with fonts 2024-08-26 22:28:02 +02:00
c5e303db74 fix: do not install Firefox package on none NisOS 2024-08-26 22:28:02 +02:00
92775021d6 chore: add home install Taskfile target 2024-08-26 22:28:02 +02:00
faf8873b43 fix: install home-manager on standalone install 2024-08-26 22:28:02 +02:00
18929340d0 feat: add Rick host (Nix on Debian) 2024-08-26 22:28:02 +02:00
7b22abd626 feat: add standalone home-manager module 2024-08-26 22:28:02 +02:00
dea3740249 fix: add option to not install package for sway / swaylock
avoid problems with nix on Debian
2024-08-26 22:28:02 +02:00
ce7338040e feat: add multiarch devshell 2024-08-26 22:28:02 +02:00
16 changed files with 285 additions and 30 deletions

55
flake.lock generated
View file

@ -1,5 +1,20 @@
{
"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": {
"inputs": {
"nixpkgs": [
@ -7,11 +22,11 @@
]
},
"locked": {
"lastModified": 1723399884,
"narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=",
"lastModified": 1724435763,
"narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "086f619dd991a4d355c07837448244029fc2d9ab",
"rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be",
"type": "github"
},
"original": {
@ -20,13 +35,34 @@
"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": {
"locked": {
"lastModified": 1723362943,
"narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=",
"lastModified": 1724819573,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a58bc8ad779655e790115244571758e8de055e3d",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github"
},
"original": {
@ -37,11 +73,11 @@
},
"nur": {
"locked": {
"lastModified": 1723580753,
"narHash": "sha256-9Zuz0QyCp+jY9vszrn4TkqpcnGKA7bM9M+da/6I0Yfs=",
"lastModified": 1725115514,
"narHash": "sha256-llfa5ShJmYH4dYAwBf8B1c1lCv1GRq385VBfq4QztLw=",
"owner": "nix-community",
"repo": "NUR",
"rev": "e36bc569a3652499909486b983ef97d319ee7271",
"rev": "2a8d5d58e80863bff01f9800f8f6f8bf9c207d0a",
"type": "github"
},
"original": {
@ -53,6 +89,7 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"nixgl": "nixgl",
"nixpkgs": "nixpkgs",
"nur": "nur"
}

View file

@ -3,20 +3,30 @@
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, nur, ... }@inputs:
outputs = { self, nixpkgs, home-manager, nur, nixgl, ... }@inputs:
let
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 {
# TODO: make a multiarch flake
devShells.x86_64-linux.default =
let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in pkgs.mkShell {
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
name = "nixfiles";
buildInputs = [
pkgs.shellcheck
@ -25,8 +35,8 @@ in {
pkgs.convco
pkgs.typos
];
};
};
});
nixosConfigurations = {
morty = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@ -74,5 +84,21 @@ 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
];
};
};
};
}

19
home-manager/default.nix Normal file
View file

@ -0,0 +1,19 @@
{ 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.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

View file

@ -0,0 +1,55 @@
{ ... }: {
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

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

View file

@ -1,15 +1,27 @@
{ lib, config, ... }:
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.application.zathura;
cfg = config.modules.application.imv;
in
{
options.modules.application.imv = {
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 {
programs.imv = {
enable = true;
package =
if cfg.installPackage
then pkgs.imv
else pkgs.emptyDirectory;
};
xdg.mimeApps.defaultApplications = {
"image/*" = "imv-dir.desktop";

View file

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

View file

@ -7,6 +7,14 @@ in
config = mkIf config.modules.desktop.sway.enable {
wayland.windowManager.sway = {
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;
systemd.enable = true;
config = {
@ -61,7 +69,10 @@ in
"${mod}+Shift+q" = "kill";
"${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel";
"${mod}+Shift+c" = "reload";
"${mod}+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock";
"${mod}+Alt+l" =
if cfg.installPackage
then "exec ${pkgs.swaylock}/bin/swaylock"
else "exec swaylock";
"${mod}+${left} focus" = "left";
"${mod}+${down} focus" = "down";
"${mod}+${up} focus" = "up";

View file

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

View file

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

View file

@ -7,6 +7,12 @@ in
{
options.modules.web.firefox = {
enable = mkEnableOption "enable Firefox web browser";
enableNixGL = mkOption {
type = types.bool;
default = false;
description = "Use NixGL to start Firefox";
};
};
config = mkIf cfg.enable {
programs.browserpass = {
@ -20,7 +26,26 @@ in
"x-scheme-handler/about" = "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 = {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
nativeMessagingHosts = [
# Tridactyl native connector
@ -28,7 +53,6 @@ in
pkgs.browserpass
];
};
enable = true;
profiles.ephase = {
id = 0;
name = "ephase";

View file

@ -1,4 +1,4 @@
{ lib, config, ... }:
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.web.qutebrowser;
@ -6,8 +6,30 @@ in
{
options.modules.web.qutebrowser = {
enable = mkEnableOption "enable Qutebrowser web browser";
enableNixGL = mkOption {
type = types.bool;
default = false;
description = "Use NixGL to start Qutebrowser";
};
};
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 = {
enable = true;
loadAutoconfig = true;

View file

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

View file

@ -29,10 +29,26 @@ tasks:
cmds:
- doas nixos-rebuild --flake .#{{.TARGET}} switch
test:*:
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- 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}}