WIP: VNC Module #62
76
.drone.yml
76
.drone.yml
|
@ -82,8 +82,82 @@ steps:
|
|||
password:
|
||||
from_secret: matrix_password
|
||||
template: "Upstreaming {{ build.status }} [{{ build.branch }}#{{ truncate build.commit 8 }}]({{ build.link }}) by {{ build.author }}. [Pull requests](https://git.b12f.io/pub-solar/os/pulls)"
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Check
|
||||
|
||||
steps:
|
||||
- name: "Check"
|
||||
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
|
||||
when:
|
||||
event:
|
||||
- pull_request
|
||||
- tag
|
||||
environment:
|
||||
NIX_FLAGS: "--print-build-logs --verbose"
|
||||
commands:
|
||||
- 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS'
|
||||
- nix $$NIX_FLAGS flake check
|
||||
- nix $$NIX_FLAGS build ".#nixosConfigurations.PubSolarOS.config.system.build.toplevel"
|
||||
- nix $$NIX_FLAGS develop --command echo OK
|
||||
- nix $$NIX_FLAGS develop --command bud --help
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Publish ISO
|
||||
|
||||
steps:
|
||||
- name: "Build ISO"
|
||||
image: docker.nix-community.org/nixpkgs/nix-flakes:latest
|
||||
volumes:
|
||||
- name: file-exchange
|
||||
path: /var/nix/iso-cache
|
||||
commands:
|
||||
- |
|
||||
nix --print-build-logs --verbose \
|
||||
develop --command \
|
||||
bud build bootstrap bootstrapIso
|
||||
- cp $(readlink -f result)/iso/*.iso /var/nix/iso-cache/
|
||||
|
||||
- name: "Publish ISO"
|
||||
image: appleboy/drone-scp
|
||||
volumes:
|
||||
- name: file-exchange
|
||||
path: /var/nix/iso-cache
|
||||
settings:
|
||||
host:
|
||||
from_secret: ssh_host
|
||||
user:
|
||||
from_secret: ssh_user
|
||||
port:
|
||||
from_secret: ssh_port
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
target: /var/www/pub.solar
|
||||
source:
|
||||
- /var/nix/iso-cache/*.iso
|
||||
strip_components: 3
|
||||
|
||||
depends_on:
|
||||
- Check
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
|
||||
volumes:
|
||||
- name: file-exchange
|
||||
temp: {}
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 07d9a95e8f577483d753e9eea76229ffe0c369ecd642bfc364ae183f662d2167
|
||||
hmac: e806a6980afdc1bf451be231db1a61e7917822a1f78afe3f2136eadfd632d521
|
||||
|
||||
...
|
||||
|
|
135
flake.lock
135
flake.lock
|
@ -87,11 +87,32 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650920635,
|
||||
"narHash": "sha256-csLLku/jHa7oTPAEJCQhFfyGYstD7jmJJV+3MiOyA+E=",
|
||||
"lastModified": 1650976225,
|
||||
"narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "1a387b8b3e4d65d7e65ae3fd85ac62b7c114c9c8",
|
||||
"rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"darwin_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"digga",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650976225,
|
||||
"narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -123,12 +144,19 @@
|
|||
}
|
||||
},
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"digga",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1637575296,
|
||||
"narHash": "sha256-ZY8YR5u8aglZPe27+AJMnPTG6645WuavB+w0xmhTarw=",
|
||||
"lastModified": 1650389807,
|
||||
"narHash": "sha256-GFRBdHMJ/T/ifaE2GS58RWpxyufH0LqI3oGS6oWAnHk=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "0e56ef21ba1a717169953122c7415fa6a8cd2618",
|
||||
"rev": "5a53bbf3eb4c908d83884d725a86b3a3bde35979",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -140,6 +168,7 @@
|
|||
"digga": {
|
||||
"inputs": {
|
||||
"blank": "blank",
|
||||
"darwin": "darwin_2",
|
||||
"deploy": [
|
||||
"deploy"
|
||||
],
|
||||
|
@ -155,14 +184,15 @@
|
|||
],
|
||||
"nixpkgs": [
|
||||
"nixos"
|
||||
]
|
||||
],
|
||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650465041,
|
||||
"narHash": "sha256-rAvwIjzHUBd2wBR0psWe2EtJr7w046TIOXZcSjLD2qg=",
|
||||
"lastModified": 1651210705,
|
||||
"narHash": "sha256-2RzKrjEnWDhsBQ4Et2gm2LjV5pXyszeqV1xNe+LtNT8=",
|
||||
"owner": "divnix",
|
||||
"repo": "digga",
|
||||
"rev": "d60f27f697d7bb8038f85917030ca706a99eea49",
|
||||
"rev": "0ffa2dff5ede12a03ca83fbc514972f94cf18f42",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -190,11 +220,11 @@
|
|||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1641205782,
|
||||
"narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
|
||||
"lastModified": 1650374568,
|
||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
|
||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -236,14 +266,14 @@
|
|||
},
|
||||
"flake-utils-plus": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2"
|
||||
"flake-utils": "flake-utils_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1639385028,
|
||||
"narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=",
|
||||
"lastModified": 1647259887,
|
||||
"narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=",
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "flake-utils-plus",
|
||||
"rev": "be1be083af014720c14f3b574f57b6173b4915d0",
|
||||
"rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -254,11 +284,11 @@
|
|||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1638122382,
|
||||
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
|
||||
"lastModified": 1642700792,
|
||||
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
|
||||
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -283,6 +313,21 @@
|
|||
}
|
||||
},
|
||||
"flake-utils_4": {
|
||||
"locked": {
|
||||
"lastModified": 1644229661,
|
||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_5": {
|
||||
"locked": {
|
||||
"lastModified": 1649676176,
|
||||
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
|
||||
|
@ -304,11 +349,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650841545,
|
||||
"narHash": "sha256-AF3fk+p/mHbdtyrI3kpms+MoMVOdGIBGJ+7LT7WWdaU=",
|
||||
"lastModified": 1651007218,
|
||||
"narHash": "sha256-NkQAMtqW0PSJTbLHalyZtaqj0ai2TZMOedug9yDIcFw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "236c6ec21420e44c38ec76de4fc3335bec1859b5",
|
||||
"rev": "d14adb99f3fb562ec74ad18c032efc154b438034",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -320,11 +365,11 @@
|
|||
},
|
||||
"latest": {
|
||||
"locked": {
|
||||
"lastModified": 1638198142,
|
||||
"narHash": "sha256-plU9b8r4St6q4U7VHtG9V7oF8k9fIpfXl/KDaZLuY9k=",
|
||||
"lastModified": 1650701402,
|
||||
"narHash": "sha256-XKfstdtqDg+O+gNBx1yGVKWIhLgfEDg/e2lvJSsp9vU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8a308775674e178495767df90c419425474582a1",
|
||||
"rev": "bc41b01dd7a9fdffd32d9b03806798797532a5fe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -336,11 +381,11 @@
|
|||
},
|
||||
"latest_2": {
|
||||
"locked": {
|
||||
"lastModified": 1650831523,
|
||||
"narHash": "sha256-6pDZ08SAXsUx5rOP391x+TG39ENP/XA8VMa1tQvgEjc=",
|
||||
"lastModified": 1651007983,
|
||||
"narHash": "sha256-GNay7yDPtLcRcKCNHldug85AhAvBpTtPEJWSSDYBw8U=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "87d34a6b8982e901b8e50096b8e79ebc0e66cda0",
|
||||
"rev": "e10da1c7f542515b609f8dfbcf788f3d85b14936",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -372,7 +417,7 @@
|
|||
},
|
||||
"nix-dram": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_3",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": [
|
||||
"latest"
|
||||
]
|
||||
|
@ -408,11 +453,11 @@
|
|||
},
|
||||
"nixos": {
|
||||
"locked": {
|
||||
"lastModified": 1650830814,
|
||||
"narHash": "sha256-P7vGsHdS19eHVUJt4BeQA4JfauL2nOpEcnYKIbX76YM=",
|
||||
"lastModified": 1651093906,
|
||||
"narHash": "sha256-kHXSbv+Hc73eV0/JVJ5YsJGr08bA4vJ3/XZew5PgZg0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c254b8c915ac912ae9ee9dc74eac555ccbf33795",
|
||||
"rev": "feea25c58657fa81d16e0e51f80e1a02ef4cbd49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -428,11 +473,11 @@
|
|||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650388175,
|
||||
"narHash": "sha256-auVEdcVtIIuBnoygUXedJewfmsf/2gSMwCrAcq/QNhM=",
|
||||
"lastModified": 1650997411,
|
||||
"narHash": "sha256-r4a3qsSv5UTtx+pxTUEdOphBkwTx1+AAVog3c457A0M=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "b0326ae4f0761b9b482b8472975b3a8e86940ce2",
|
||||
"rev": "3cdf22c79bc80910e2b610cd59fcb8408354ddbc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -472,6 +517,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1650726686,
|
||||
"narHash": "sha256-hE5PCqQlsdgWH3AUTwesvjZWs5ZUZ8SjMS5cnFB6W54=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3c0f57e36ed0cf9947281e3b31f1bebb7ce5d4a1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1637186689,
|
||||
|
@ -504,7 +565,7 @@
|
|||
"nvfetcher": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"flake-utils": "flake-utils_5",
|
||||
"nixpkgs": [
|
||||
"nixos"
|
||||
]
|
||||
|
|
13
flake.nix
13
flake.nix
|
@ -68,6 +68,8 @@
|
|||
|
||||
channelsConfig = { allowUnfree = true; };
|
||||
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
|
||||
channels = {
|
||||
nixos = {
|
||||
imports = [ (digga.lib.importOverlays ./overlays) ];
|
||||
|
@ -110,16 +112,17 @@
|
|||
imports = [ (digga.lib.importHosts ./hosts) ];
|
||||
hosts = {
|
||||
/* set host specific properties here */
|
||||
NixOS = { };
|
||||
PubSolarOS = { };
|
||||
};
|
||||
importables = rec {
|
||||
profiles = digga.lib.rakeLeaves ./profiles // {
|
||||
users = digga.lib.rakeLeaves ./users;
|
||||
};
|
||||
suites = with profiles; rec {
|
||||
base = [ core users.nixos users.root ];
|
||||
pubsolaros = [ core base-user users.root ];
|
||||
anonymous = [ pubsolaros users.nixos ];
|
||||
base = [ core users.pub-solar users.root ];
|
||||
iso = base ++ [ base-user graphical pub-solar-iso ];
|
||||
pubsolaros = [ core full-install base-user users.root ];
|
||||
anonymous = [ pubsolaros users.pub-solar ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -134,7 +137,7 @@
|
|||
};
|
||||
};
|
||||
users = {
|
||||
nixos = { suites, ... }: { imports = suites.base; };
|
||||
pub-solar = { suites, ... }: { imports = suites.base; };
|
||||
}; # digga.lib.importers.rakeLeaves ./users/hm;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
{ suites, ... }:
|
||||
{
|
||||
### root password is empty by default ###
|
||||
imports = suites.base;
|
||||
### default password: pub-solar, optional: add your SSH keys
|
||||
imports =
|
||||
suites.iso
|
||||
;
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
# profiles.networking
|
||||
profiles.core
|
||||
profiles.users.root # make sure to configure ssh keys
|
||||
profiles.users.nixos
|
||||
profiles.users.pub-solar
|
||||
profiles.base-user
|
||||
profiles.graphical
|
||||
profiles.pub-solar-iso
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
let
|
||||
inherit (default.inputs.nixos) lib;
|
||||
|
||||
host = configs.${hostname} or configs.NixOS;
|
||||
host = configs.${hostname} or configs.PubSolarOS;
|
||||
configs = default.nixosConfigurations;
|
||||
default = (import ../.).defaultNix;
|
||||
hostname = lib.fileContents /etc/hostname;
|
||||
|
|
|
@ -8,6 +8,8 @@ in
|
|||
{
|
||||
options.pub-solar.audio = {
|
||||
enable = mkEnableOption "Life in highs and lows";
|
||||
mopidy.enable = mkEnableOption "Life with mopidy";
|
||||
bluetooth.enable = mkEnableOption "Life with bluetooth";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -43,7 +45,7 @@ in
|
|||
config.pipewire-pulse = builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json);
|
||||
|
||||
# Bluetooth configuration for pipewire
|
||||
media-session.config.bluez-monitor.rules = [
|
||||
media-session.config.bluez-monitor.rules = mkIf cfg.bluetooth.enable [
|
||||
{
|
||||
# Matches all cards
|
||||
matches = [{ "device.name" = "~bluez_card.*"; }];
|
||||
|
@ -70,10 +72,10 @@ in
|
|||
};
|
||||
|
||||
# Enable bluetooth
|
||||
hardware.bluetooth.enable = true;
|
||||
services.blueman.enable = true;
|
||||
hardware.bluetooth.enable = mkIf cfg.bluetooth.enable true;
|
||||
services.blueman.enable = mkIf cfg.bluetooth.enable true;
|
||||
|
||||
# Enable audio server & client
|
||||
services.mopidy = import ./mopidy.nix pkgs;
|
||||
services.mopidy = mkIf cfg.mopidy.enable ((import ./mopidy.nix) pkgs);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ in
|
|||
};
|
||||
|
||||
home.packages = [
|
||||
gnome3.seahorse
|
||||
gnome.seahorse
|
||||
keepassxc
|
||||
libsecret
|
||||
qMasterPassword
|
||||
|
|
|
@ -15,7 +15,8 @@ in
|
|||
drone-cli
|
||||
nmap
|
||||
pgcli
|
||||
python38Packages.ansible
|
||||
ansible
|
||||
ansible-lint
|
||||
restic
|
||||
shellcheck
|
||||
terraform_0_15
|
||||
|
|
|
@ -26,6 +26,11 @@ in
|
|||
default = { };
|
||||
};
|
||||
};
|
||||
wayland.software-renderer.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Feature flag enabling wlroots software renderer, useful in VMs";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -49,7 +54,7 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
services.getty.autologinUser = "${psCfg.user.name}";
|
||||
services.getty.autologinUser = mkForce "${psCfg.user.name}";
|
||||
|
||||
qt5 = {
|
||||
enable = true;
|
||||
|
@ -81,17 +86,20 @@ in
|
|||
source-sans-pro
|
||||
];
|
||||
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home-manager = with pkgs; setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
alacritty
|
||||
foot
|
||||
chromium
|
||||
firefox-wayland
|
||||
|
||||
flameshot
|
||||
libnotify
|
||||
gnome3.adwaita-icon-theme
|
||||
gnome.adwaita-icon-theme
|
||||
gnome.eog
|
||||
gnome3.nautilus
|
||||
gnome.nautilus
|
||||
gnome.yelp
|
||||
hicolor-icon-theme
|
||||
|
||||
wine
|
||||
|
||||
|
@ -112,7 +120,7 @@ in
|
|||
enable = true;
|
||||
font.name = "Lato";
|
||||
iconTheme = {
|
||||
package = pkgs.papirus-maia-icon-theme;
|
||||
package = pkgs.papirus-icon-theme;
|
||||
name = "Papirus-Adapta-Nokto-Maia";
|
||||
};
|
||||
theme = {
|
||||
|
|
|
@ -17,7 +17,7 @@ in
|
|||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
libreoffice-fresh
|
||||
gnome3.simple-scan
|
||||
gnome.simple-scan
|
||||
# Tools like pdfunite
|
||||
poppler_utils
|
||||
# tool for annotating PDFs
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
cfg = config.pub-solar.server;
|
||||
in
|
||||
{
|
||||
options.pub-solar.server = {
|
||||
enable = mkEnableOption "Enable server options like sshd";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
permitRootLogin = "no";
|
||||
passwordAuthentication = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -12,8 +12,7 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
#mySignalDesktop
|
||||
signal-desktop
|
||||
ps-signal-desktop
|
||||
tdesktop
|
||||
element-desktop
|
||||
irssi
|
||||
|
|
|
@ -1,212 +0,0 @@
|
|||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left j
|
||||
set $down k
|
||||
set $up i
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term alacritty
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
#set $menu dmenu_path | dmenu | xargs swaymsg exec bemenu-run --no-overlap
|
||||
|
||||
default_border pixel 1
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||
output * bg ~/.config/wallpaper.jpg fill
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Start a terminal
|
||||
bindsym $mod+Shift+Return exec sh -c '$term --working-directory $(wcwd)'
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+Ctrl+r reload
|
||||
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
# Or use $mod+[up|down|left|right]
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
# Ditto, with arrow keys
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
|
||||
|
||||
# Workspace names
|
||||
# to display names or symbols instead of plain workspace numbers you can use
|
||||
# something like: set $ws1 1:mail
|
||||
# set $ws2 2:
|
||||
set $ws1 1
|
||||
set $ws2 2
|
||||
set $ws3 3
|
||||
set $ws4 4
|
||||
set $ws5 5
|
||||
set $ws6 6
|
||||
set $ws7 7
|
||||
set $ws8 8
|
||||
set $ws9 9
|
||||
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace 1
|
||||
bindsym $mod+2 workspace 2
|
||||
bindsym $mod+3 workspace 3
|
||||
bindsym $mod+4 workspace 4
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Ctrl+1 move container to workspace $ws1
|
||||
bindsym $mod+Ctrl+2 move container to workspace $ws2
|
||||
bindsym $mod+Ctrl+3 move container to workspace $ws3
|
||||
bindsym $mod+Ctrl+4 move container to workspace $ws4
|
||||
bindsym $mod+Ctrl+5 move container to workspace $ws5
|
||||
bindsym $mod+Ctrl+6 move container to workspace $ws6
|
||||
bindsym $mod+Ctrl+7 move container to workspace $ws7
|
||||
bindsym $mod+Ctrl+8 move container to workspace $ws8
|
||||
bindsym $mod+Ctrl+9 move container to workspace $ws9
|
||||
# Move focused container to workspace and move focus with it
|
||||
bindsym $mod+Shift+1 move container to workspace 1; workspace $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace 2; workspace $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace 3; workspace $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace 4; workspace $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace 5; workspace $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace 6; workspace $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace 7; workspace $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace 8; workspace $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace 9; workspace $ws9
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
|
||||
#navigate workspaces next / previous
|
||||
bindsym $mod+Ctrl+Right workspace next
|
||||
bindsym $mod+Ctrl+Left workspace prev
|
||||
|
||||
# workspace back and forth (with/without active container)
|
||||
workspace_auto_back_and_forth yes
|
||||
bindsym $mod+b workspace back_and_forth
|
||||
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
|
||||
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# Configure border style <normal|1pixel|pixel xx|none|pixel>
|
||||
default_border pixel 1
|
||||
default_floating_border normal
|
||||
|
||||
# Hide borders
|
||||
hide_edge_borders none
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
font xft:Hack 16
|
||||
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
bindsym $mod+h splith; exec notify-send 'tile horizontally'
|
||||
bindsym $mod+v splitv; exec notify-send 'tile vertically'
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+t focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
bindsym $mod+d focus child
|
||||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
||||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
bindsym $left resize shrink width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize grow width 10px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 10px
|
||||
bindsym Down resize grow height 10px
|
||||
bindsym Up resize shrink height 10px
|
||||
bindsym Right resize grow width 10px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
include ~/.config/sway/config.d/*
|
214
modules/sway/config/config.nix
Normal file
214
modules/sway/config/config.nix
Normal file
|
@ -0,0 +1,214 @@
|
|||
{ config, pkgs, ... }:
|
||||
''
|
||||
# Default config for sway
|
||||
#
|
||||
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||
#
|
||||
# Read `man 5 sway` for a complete reference.
|
||||
|
||||
### Variables
|
||||
#
|
||||
# Logo key. Use Mod1 for Alt.
|
||||
set $mod Mod4
|
||||
# Home row direction keys, like vim
|
||||
set $left j
|
||||
set $down k
|
||||
set $up i
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term ${config.pub-solar.sway.terminal}
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
#set $menu dmenu_path | dmenu | xargs swaymsg exec bemenu-run --no-overlap
|
||||
|
||||
default_border pixel 1
|
||||
|
||||
### Output configuration
|
||||
#
|
||||
# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/)
|
||||
output * bg ~/.config/wallpaper.jpg fill
|
||||
|
||||
### Key bindings
|
||||
#
|
||||
# Basics:
|
||||
#
|
||||
# Start a terminal
|
||||
bindsym $mod+Return exec $term
|
||||
|
||||
# Start a terminal
|
||||
bindsym $mod+Shift+Return exec sh -c '$term --working-directory $(wcwd)'
|
||||
|
||||
# Kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# Drag floating windows by holding down $mod and left mouse button.
|
||||
# Resize them with right mouse button + $mod.
|
||||
# Despite the name, also works for non-floating windows.
|
||||
# Change normal to inverse to use left mouse button for resizing and right
|
||||
# mouse button for dragging.
|
||||
floating_modifier $mod normal
|
||||
|
||||
# Reload the configuration file
|
||||
bindsym $mod+Ctrl+r reload
|
||||
|
||||
#
|
||||
# Moving around:
|
||||
#
|
||||
# Move your focus around
|
||||
bindsym $mod+$left focus left
|
||||
bindsym $mod+$down focus down
|
||||
bindsym $mod+$up focus up
|
||||
bindsym $mod+$right focus right
|
||||
# Or use $mod+[up|down|left|right]
|
||||
bindsym $mod+Left focus left
|
||||
bindsym $mod+Down focus down
|
||||
bindsym $mod+Up focus up
|
||||
bindsym $mod+Right focus right
|
||||
|
||||
# Move the focused window with the same, but add Shift
|
||||
bindsym $mod+Shift+$left move left
|
||||
bindsym $mod+Shift+$down move down
|
||||
bindsym $mod+Shift+$up move up
|
||||
bindsym $mod+Shift+$right move right
|
||||
# Ditto, with arrow keys
|
||||
bindsym $mod+Shift+Left move left
|
||||
bindsym $mod+Shift+Down move down
|
||||
bindsym $mod+Shift+Up move up
|
||||
bindsym $mod+Shift+Right move right
|
||||
#
|
||||
# Workspaces:
|
||||
#
|
||||
|
||||
|
||||
# Workspace names
|
||||
# to display names or symbols instead of plain workspace numbers you can use
|
||||
# something like: set $ws1 1:mail
|
||||
# set $ws2 2:
|
||||
set $ws1 1
|
||||
set $ws2 2
|
||||
set $ws3 3
|
||||
set $ws4 4
|
||||
set $ws5 5
|
||||
set $ws6 6
|
||||
set $ws7 7
|
||||
set $ws8 8
|
||||
set $ws9 9
|
||||
|
||||
# Switch to workspace
|
||||
bindsym $mod+1 workspace 1
|
||||
bindsym $mod+2 workspace 2
|
||||
bindsym $mod+3 workspace 3
|
||||
bindsym $mod+4 workspace 4
|
||||
bindsym $mod+5 workspace 5
|
||||
bindsym $mod+6 workspace 6
|
||||
bindsym $mod+7 workspace 7
|
||||
bindsym $mod+8 workspace 8
|
||||
bindsym $mod+9 workspace 9
|
||||
# Move focused container to workspace
|
||||
bindsym $mod+Ctrl+1 move container to workspace $ws1
|
||||
bindsym $mod+Ctrl+2 move container to workspace $ws2
|
||||
bindsym $mod+Ctrl+3 move container to workspace $ws3
|
||||
bindsym $mod+Ctrl+4 move container to workspace $ws4
|
||||
bindsym $mod+Ctrl+5 move container to workspace $ws5
|
||||
bindsym $mod+Ctrl+6 move container to workspace $ws6
|
||||
bindsym $mod+Ctrl+7 move container to workspace $ws7
|
||||
bindsym $mod+Ctrl+8 move container to workspace $ws8
|
||||
bindsym $mod+Ctrl+9 move container to workspace $ws9
|
||||
# Move focused container to workspace and move focus with it
|
||||
bindsym $mod+Shift+1 move container to workspace 1; workspace $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace 2; workspace $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace 3; workspace $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace 4; workspace $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace 5; workspace $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace 6; workspace $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace 7; workspace $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace 8; workspace $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace 9; workspace $ws9
|
||||
# Note: workspaces can have any name you want, not just numbers.
|
||||
# We just use 1-10 as the default.
|
||||
|
||||
#navigate workspaces next / previous
|
||||
bindsym $mod+Ctrl+Right workspace next
|
||||
bindsym $mod+Ctrl+Left workspace prev
|
||||
|
||||
# workspace back and forth (with/without active container)
|
||||
workspace_auto_back_and_forth yes
|
||||
bindsym $mod+b workspace back_and_forth
|
||||
bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth
|
||||
|
||||
#
|
||||
# Layout stuff:
|
||||
#
|
||||
# Configure border style <normal|1pixel|pixel xx|none|pixel>
|
||||
default_border pixel 1
|
||||
default_floating_border normal
|
||||
|
||||
# Hide borders
|
||||
hide_edge_borders none
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
font xft:Hack 16
|
||||
|
||||
# You can "split" the current object of your focus with
|
||||
# $mod+b or $mod+v, for horizontal and vertical splits
|
||||
# respectively.
|
||||
bindsym $mod+h splith; exec notify-send 'tile horizontally'
|
||||
bindsym $mod+v splitv; exec notify-send 'tile vertically'
|
||||
|
||||
# Switch the current container between different layout styles
|
||||
bindsym $mod+s layout stacking
|
||||
bindsym $mod+w layout tabbed
|
||||
bindsym $mod+e layout toggle split
|
||||
|
||||
# Make the current focus fullscreen
|
||||
bindsym $mod+f fullscreen
|
||||
|
||||
# Toggle the current focus between tiling and floating mode
|
||||
bindsym $mod+Shift+space floating toggle
|
||||
|
||||
# Swap focus between the tiling area and the floating area
|
||||
bindsym $mod+t focus mode_toggle
|
||||
|
||||
# Move focus to the parent container
|
||||
bindsym $mod+a focus parent
|
||||
bindsym $mod+d focus child
|
||||
#
|
||||
# Scratchpad:
|
||||
#
|
||||
# Sway has a "scratchpad", which is a bag of holding for windows.
|
||||
# You can send windows there and get them back later.
|
||||
|
||||
# Move the currently focused window to the scratchpad
|
||||
bindsym $mod+Shift+minus move scratchpad
|
||||
|
||||
# Show the next scratchpad window or hide the focused scratchpad window.
|
||||
# If there are multiple scratchpad windows, this command cycles through them.
|
||||
bindsym $mod+minus scratchpad show
|
||||
#
|
||||
# Resizing containers:
|
||||
#
|
||||
mode "resize" {
|
||||
# left will shrink the containers width
|
||||
# right will grow the containers width
|
||||
# up will shrink the containers height
|
||||
# down will grow the containers height
|
||||
bindsym $left resize shrink width 10px
|
||||
bindsym $down resize grow height 10px
|
||||
bindsym $up resize shrink height 10px
|
||||
bindsym $right resize grow width 10px
|
||||
|
||||
# Ditto, with arrow keys
|
||||
bindsym Left resize shrink width 10px
|
||||
bindsym Down resize grow height 10px
|
||||
bindsym Up resize shrink height 10px
|
||||
bindsym Right resize grow width 10px
|
||||
|
||||
# Return to default mode
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
bindsym $mod+r mode "resize"
|
||||
|
||||
include ~/.config/sway/config.d/*''
|
|
@ -9,6 +9,12 @@ in
|
|||
options.pub-solar.sway = {
|
||||
enable = mkEnableOption "Life in boxes";
|
||||
|
||||
terminal = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "alacritty";
|
||||
description = "Choose sway's default terminal";
|
||||
};
|
||||
|
||||
v4l2loopback.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -17,7 +23,7 @@ in
|
|||
};
|
||||
|
||||
options.pub-solar.sway-headless = {
|
||||
headless.enable = mkEnableOption "Enable headless sway and vnc service";
|
||||
enable = mkEnableOption "Enable headless sway and vnc service";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
@ -37,7 +43,17 @@ in
|
|||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
|
||||
wlr = {
|
||||
enable = true;
|
||||
settings = {
|
||||
screencast = {
|
||||
max_fps = 30;
|
||||
chooser_type = "simple";
|
||||
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
|
||||
};
|
||||
};
|
||||
};
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
gtkUsePortal = true;
|
||||
};
|
||||
|
||||
|
@ -81,10 +97,7 @@ in
|
|||
systemd.user.services.waybar = import ./waybar.service.nix pkgs;
|
||||
systemd.user.targets.sway-session = import ./sway-session.target.nix pkgs;
|
||||
|
||||
systemd.user.services.sway-headless = mkIf cfg.vnc.enable (import ./wayvnc.service.nix pkgs);
|
||||
systemd.user.services.wayvnc = mkIf cfg.vnc.enable (import ./wayvnc.service.nix pkgs);
|
||||
|
||||
xdg.configFile."sway/config".source = ./config/config;
|
||||
xdg.configFile."sway/config".text = import ./config/config.nix { inherit config pkgs; };
|
||||
xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf;
|
||||
xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf;
|
||||
xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf;
|
||||
|
|
|
@ -26,6 +26,7 @@ in
|
|||
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
|
||||
home.packages = [
|
||||
ack
|
||||
asciinema
|
||||
ag
|
||||
bat
|
||||
exa
|
||||
|
|
|
@ -67,9 +67,7 @@ in
|
|||
nodePackages.typescript-language-server
|
||||
nodePackages.vim-language-server
|
||||
nodePackages.vue-language-server
|
||||
nodePackages.vscode-css-languageserver-bin
|
||||
nodePackages.vscode-html-languageserver-bin
|
||||
nodePackages.vscode-json-languageserver-bin
|
||||
nodePackages.vscode-langservers-extracted
|
||||
nodePackages.yaml-language-server
|
||||
python39Packages.python-lsp-server
|
||||
python3Full
|
||||
|
@ -128,6 +126,7 @@ in
|
|||
vim-go
|
||||
vim-javascript
|
||||
vim-json
|
||||
SchemaStore-nvim
|
||||
vim-markdown
|
||||
vim-nix
|
||||
vim-ruby
|
||||
|
|
|
@ -8,6 +8,14 @@ set completeopt=menuone,noinsert,noselect
|
|||
" Avoid showing extra messages when using completion
|
||||
set shortmess+=c
|
||||
|
||||
function AddTemplate(tmpl_file)
|
||||
exe "0read " . a:tmpl_file
|
||||
set nomodified
|
||||
6
|
||||
endfunction
|
||||
|
||||
autocmd BufNewFile shell.nix call AddTemplate("$XDG_DATA_HOME/nvim/templates/shell.nix.tmpl")
|
||||
|
||||
" Configure neovim 0.6+ experimental LSPs
|
||||
" https://github.com/neovim/nvim-lspconfig
|
||||
" https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
|
@ -46,12 +54,31 @@ lua <<EOF
|
|||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
|
||||
-- Show diagnostic popup on cursor hold
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
local opts = {
|
||||
focusable = false,
|
||||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
prefix = ' ',
|
||||
scope = 'cursor',
|
||||
}
|
||||
vim.diagnostic.open_float(nil, opts)
|
||||
end
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||
|
||||
-- vscode HTML lsp needs this https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
for lsp_key, lsp_settings in pairs({
|
||||
'bashls', ------------------------------- Bash
|
||||
'ccls', --------------------------------- C / C++ / Objective-C
|
||||
|
@ -76,10 +103,14 @@ lua <<EOF
|
|||
}
|
||||
},
|
||||
['jsonls'] = { -------------------------- JSON
|
||||
['cmd'] = {"json-languageserver", "--stdio"}
|
||||
['settings'] = {
|
||||
['json'] = {
|
||||
['schemas' ] = require('schemastore').json.schemas()
|
||||
}
|
||||
}
|
||||
},
|
||||
'phpactor', ----------------------------- PHP
|
||||
'pylsp', --------------------------------- Python
|
||||
'pylsp', -------------------------------- Python
|
||||
'rnix', --------------------------------- Nix
|
||||
'solargraph', --------------------------- Ruby
|
||||
'rust_analyzer', ------------------------ Rust
|
||||
|
@ -90,7 +121,6 @@ lua <<EOF
|
|||
['filetypes'] = { "terraform", "hcl", "tf" }
|
||||
},
|
||||
'tsserver', ----------------------------- Typescript / JavaScript
|
||||
'angularls', ---------------------------- Angular
|
||||
'vuels', -------------------------------- Vue
|
||||
'svelte', ------------------------------- Svelte
|
||||
['yamlls'] = { -------------------------- YAML
|
||||
|
@ -101,6 +131,7 @@ lua <<EOF
|
|||
['https://json.schemastore.org/github-action'] = '.github/action.{yml,yaml}',
|
||||
['https://json.schemastore.org/ansible-stable-2.9'] = 'roles/tasks/*.{yml,yaml}',
|
||||
['https://json.schemastore.org/drone'] = '*.drone.{yml,yaml}',
|
||||
['https://json.schemastore.org/swagger-2.0'] = 'swagger.{yml,yaml}',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -190,9 +221,6 @@ for type, icon in pairs(signs) do
|
|||
end
|
||||
EOF
|
||||
|
||||
" Show diagnostic popup on cursor hold
|
||||
autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, { focus = false, scope = "cursor" })
|
||||
|
||||
" have a fixed column for the diagnostics to appear in
|
||||
" this removes the jitter when warnings/errors flow in
|
||||
set signcolumn=yes:2
|
||||
|
|
|
@ -9,8 +9,10 @@ let g:gutentags_file_list_command = 'git ls-files'
|
|||
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
|
||||
|
||||
" Golang
|
||||
" Go test shortcut
|
||||
" Go test, Def, Decls shortcut
|
||||
nmap <Leader>got :GoTest<CR>:botright copen<CR>
|
||||
autocmd FileType go nmap gd :GoDef<CR>
|
||||
autocmd FileType go nmap gD :GoDecls<CR>
|
||||
|
||||
" Go formatting
|
||||
autocmd FileType go setlocal noexpandtab shiftwidth=4 tabstop=4 softtabstop=4 nolist
|
||||
|
|
|
@ -22,7 +22,6 @@ in
|
|||
[ "$(tty)" = "/dev/tty1" ] && exec sway
|
||||
'';
|
||||
|
||||
|
||||
shellAliases = {
|
||||
nano = "nvim";
|
||||
vi = "nvim";
|
||||
|
@ -72,18 +71,24 @@ in
|
|||
bindkey '^R' fzf-history-widget
|
||||
|
||||
# ArrowUp/Down start searching history with current input
|
||||
autoload -U history-search-end
|
||||
zle -N history-beginning-search-backward-end history-search-end
|
||||
zle -N history-beginning-search-forward-end history-search-end
|
||||
bindkey "^[[A" history-beginning-search-backward-end
|
||||
bindkey "^[[B" history-beginning-search-forward-end
|
||||
bindkey "^P" history-beginning-search-backward-end
|
||||
bindkey "^N" history-beginning-search-forward-end
|
||||
autoload -U up-line-or-beginning-search
|
||||
autoload -U down-line-or-beginning-search
|
||||
zle -N up-line-or-beginning-search
|
||||
zle -N down-line-or-beginning-search
|
||||
bindkey "^[[A" up-line-or-beginning-search
|
||||
bindkey "^[[B" down-line-or-beginning-search
|
||||
bindkey "^P" up-line-or-beginning-search
|
||||
bindkey "^N" down-line-or-beginning-search
|
||||
|
||||
# MAKE CTRL+S WORK IN VIM
|
||||
stty -ixon
|
||||
stty erase '^?'
|
||||
|
||||
precmd () {
|
||||
DIR_NAME=$(pwd | sed "s|^$HOME|~|g")
|
||||
echo -e "\e]2;$DIR_NAME\e\\"
|
||||
}
|
||||
|
||||
# If a command is not found, show me where it is
|
||||
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
|
||||
''
|
||||
|
|
|
@ -195,7 +195,16 @@
|
|||
typeset -g POWERLEVEL9K_DIR_{HOME,HOME_SUBFOLDER}_BACKGROUND=1
|
||||
typeset -g POWERLEVEL9K_DIR_NOT_WRITABLE_BACKGROUND=1
|
||||
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
|
||||
# If directory is too long, shorten some of its segments to the shortest possible unique
|
||||
# prefix. The shortened directory can be tab-completed to the original.
|
||||
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
|
||||
# Color of the shortened directory segments.
|
||||
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=0
|
||||
# Color of the anchor directory segments. Anchor segments are never shortened. The first
|
||||
# segment is always an anchor.
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=0
|
||||
# Display anchor directory segments in bold.
|
||||
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=false
|
||||
# Don't shorten directories that contain any of these files. They are anchors.
|
||||
local anchor_files=(
|
||||
.bzr
|
||||
|
@ -228,13 +237,13 @@
|
|||
# contains a marker (.git) and other directories don't.
|
||||
typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
|
||||
# Don't shorten this many last directory segments. They are anchors.
|
||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=100
|
||||
typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
|
||||
# Shorten directory if it's longer than this even if there is space for it. The value can
|
||||
# be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty,
|
||||
# directory will be shortened only when prompt doesn't fit or when other parameters demand it
|
||||
# (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below).
|
||||
# If set to `0`, directory will always be shortened to its minimum length.
|
||||
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=
|
||||
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
|
||||
# When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this
|
||||
# many columns for typing commands.
|
||||
typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
|
||||
|
|
|
@ -21,6 +21,11 @@ in
|
|||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
publicKeys = mkOption {
|
||||
description = "User SSH public keys";
|
||||
type = types.listOf types.path;
|
||||
default = [ ];
|
||||
};
|
||||
fullName = mkOption {
|
||||
description = "User full name";
|
||||
type = types.nullOr types.str;
|
||||
|
|
|
@ -14,12 +14,13 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
boot.kernelParams = [
|
||||
"amd_iommu=on"
|
||||
"intel_iommu=on"
|
||||
"iommu=pt"
|
||||
];
|
||||
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemuOvmf = true;
|
||||
qemu.ovmf.enable = true;
|
||||
};
|
||||
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
|
||||
extraGroups = [ "libvirtd" ];
|
||||
|
|
|
@ -1,16 +1,22 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.pub-solar.x-os;
|
||||
in
|
||||
{
|
||||
options.pub-solar.x-os.iso-options.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Feature flag for iso builds";
|
||||
};
|
||||
config = {
|
||||
# Enable plymouth for better experience of booting
|
||||
boot.plymouth.enable = true;
|
||||
|
||||
# Mount / luks device in initrd
|
||||
# Allow fstrim to work on it.
|
||||
boot.initrd = {
|
||||
# The ! makes this enabled by default
|
||||
boot.initrd = mkIf (!cfg.iso-options.enable) {
|
||||
luks.devices."cryptroot" = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
|
|
|
@ -14,6 +14,7 @@ channels: final: prev: {
|
|||
starship
|
||||
deploy-rs
|
||||
|
||||
nixUnstable
|
||||
neovim-unwrapped
|
||||
tdesktop
|
||||
xdg-desktop-portal
|
||||
|
|
|
@ -16,4 +16,7 @@ with final; {
|
|||
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
|
||||
uhk-agent = import ./uhk-agent.nix final;
|
||||
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
|
||||
|
||||
# ps-fixes
|
||||
ps-signal-desktop = writeShellScriptBin "signal-desktop" (import ./ps-signal-desktop.nix final);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
self: with self; ''
|
||||
${self.looking-glass-client}/bin/looking-glass-client -f /dev/shm/looking-glass input:ignoreWindowsKeys=yes input:grabKeyboardOnFocus=no
|
||||
self: with self;
|
||||
let
|
||||
looking-glass-client = self.looking-glass-client.overrideAttrs (old: {
|
||||
meta.platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||
});
|
||||
in
|
||||
''
|
||||
${looking-glass-client}/bin/looking-glass-client -f /dev/shm/looking-glass input:ignoreWindowsKeys=yes input:grabKeyboardOnFocus=no
|
||||
''
|
||||
|
|
9
pkgs/ps-signal-desktop.nix
Normal file
9
pkgs/ps-signal-desktop.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
self: with self;
|
||||
let
|
||||
signal-desktop = self.signal-desktop.overrideAttrs (old: {
|
||||
meta.platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||
});
|
||||
in
|
||||
''
|
||||
exec ${signal-desktop}/bin/signal-desktop --disable-gpu -- "$@"
|
||||
''
|
6
profiles/audio/default.nix
Normal file
6
profiles/audio/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
let inherit (lib) fileContents;
|
||||
in
|
||||
{
|
||||
pub-solar.audio.enable = true;
|
||||
}
|
|
@ -24,6 +24,7 @@ in
|
|||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
template = ${xdg.configHome}/git/gitmessage
|
||||
[tag]
|
||||
gpgsign = true
|
||||
[init]
|
||||
|
|
32
profiles/base-user/.config/git/gitmessage.nix
Normal file
32
profiles/base-user/.config/git/gitmessage.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
user = config.pub-solar.user;
|
||||
xdg = config.home-manager.users."${user.name}".xdg;
|
||||
in
|
||||
''
|
||||
# Title: Summary, imperative, start upper case, don't end with a period
|
||||
# No more than 50 chars. #### 50 chars is here: #
|
||||
#
|
||||
|
||||
|
||||
# ^ Remember ending with an extra blank line
|
||||
# Body: Explain *what* and *why* (not *how*). Include issue number.
|
||||
# Wrap at 72 chars. ################################## which is here: #
|
||||
#
|
||||
|
||||
|
||||
# ^ Remember ending with an extra blank line
|
||||
# At the end: Include Co-authored-by for all contributors.
|
||||
#
|
||||
Co-authored-by: ${user.fullName} <${user.email}>
|
||||
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit.
|
||||
#
|
||||
# On branch master
|
||||
# Your branch is up to date with 'origin/main'.
|
||||
#
|
||||
# Changes to be committed:
|
||||
# new file: installation.md
|
||||
#
|
||||
''
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"height": 26, // Waybar height
|
||||
"modules-left": ["sway/workspaces", "sway/mode"],
|
||||
"modules-center": ["mpd"],
|
||||
//"modules-center": ["mpd"],
|
||||
"modules-right": ["sway/language", "pulseaudio", "network", "idle_inhibitor", "battery", "clock", "tray"],
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true
|
||||
|
|
|
@ -19,6 +19,7 @@ in
|
|||
extraGroups = [ "wheel" "docker" "input" "audio" "networkmanager" "lp" "scanner" ];
|
||||
initialHashedPassword = if psCfg.user.password != null then psCfg.user.password else "";
|
||||
shell = pkgs.zsh;
|
||||
openssh.authorizedKeys.keyFiles = if psCfg.user.publicKeys != null then psCfg.user.publicKeys else [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ in
|
|||
|
||||
home.packages = with pkgs; [ ];
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
fonts.fontconfig.enable = mkForce true;
|
||||
|
||||
programs.dircolors.enable = true;
|
||||
programs.dircolors.enableZshIntegration = true;
|
||||
|
@ -32,6 +32,7 @@ in
|
|||
xdg.mimeApps = import ./mimeapps.nix;
|
||||
|
||||
xdg.configFile."git/config".text = import ./.config/git/config.nix { inherit config; inherit pkgs; };
|
||||
xdg.configFile."git/gitmessage".text = import ./.config/git/gitmessage.nix { inherit config; inherit pkgs; };
|
||||
xdg.configFile."git/global_gitignore".text = import ./.config/git/global_gitignore.nix { inherit config; inherit pkgs; };
|
||||
xdg.configFile."dircolors".source = ./.config/dircolors;
|
||||
xdg.configFile."xmodmap".source = ./.config/xmodmap;
|
||||
|
@ -54,6 +55,20 @@ in
|
|||
# Ensure nvim backup directory gets created
|
||||
# Workaround for E510: Can't make backup file (add ! to override)
|
||||
xdg.dataFile."nvim/backup/.keep".text = "";
|
||||
xdg.dataFile."nvim/templates/.keep".text = "";
|
||||
xdg.dataFile."shell.nix.tmpl" = {
|
||||
text = ''
|
||||
let
|
||||
unstable = import (fetchTarball https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz) { };
|
||||
in
|
||||
{ nixpkgs ? import <nixpkgs> {} }:
|
||||
with nixpkgs; mkShell {
|
||||
buildInputs = [
|
||||
];
|
||||
}
|
||||
'';
|
||||
target = "nvim/templates/shell.nix.tmpl";
|
||||
};
|
||||
|
||||
# Allow unfree packages only on a user basis, not on a system-wide basis
|
||||
xdg.configFile."nixpkgs/config.nix".text = " { allowUnfree = true; } ";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
psCfg = config.pub-solar;
|
||||
wlroots = psCfg.graphical.wayland;
|
||||
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
||||
variables = {
|
||||
XDG_CONFIG_HOME = xdg.configHome;
|
||||
|
@ -15,6 +16,7 @@ let
|
|||
ECORE_EVAS_ENGINE = "wayland_egl";
|
||||
ELM_ENGINE = "wayland_egl";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
WLR_RENDERER = if wlroots.software-renderer.enable then "pixman" else "gles2";
|
||||
|
||||
EDITOR = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim";
|
||||
VISUAL = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim";
|
||||
|
|
|
@ -10,12 +10,6 @@ in
|
|||
pub-solar.audio.enable = true;
|
||||
pub-solar.crypto.enable = true;
|
||||
pub-solar.devops.enable = true;
|
||||
pub-solar.docker.enable = true;
|
||||
pub-solar.nextcloud.enable = true;
|
||||
pub-solar.office.enable = true;
|
||||
# pub-solar.printing.enable = true; # this is enabled automatically if office is enabled
|
||||
pub-solar.server.enable = true;
|
||||
pub-solar.printing.enable = true;
|
||||
|
||||
# This is just a representation of the nix default
|
||||
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
|
@ -28,6 +22,7 @@ in
|
|||
progress
|
||||
dnsutils
|
||||
inetutils
|
||||
mtr
|
||||
pciutils
|
||||
usbutils
|
||||
gitFull
|
||||
|
@ -74,6 +69,7 @@ in
|
|||
# Build broken, python2.7-PyJWT-2.0.1.drv' failed
|
||||
#nixops
|
||||
psos
|
||||
nvd
|
||||
|
||||
# Fun
|
||||
neofetch
|
||||
|
@ -127,7 +123,9 @@ in
|
|||
# Service that makes Out of Memory Killer more effective
|
||||
services.earlyoom.enable = true;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
# Use latest LTS linux kernel by default
|
||||
boot.kernelPackages = pkgs.linuxPackages_5_15;
|
||||
|
||||
boot.supportedFilesystems = [ "ntfs" ];
|
||||
};
|
||||
}
|
||||
|
|
15
profiles/full-install/default.nix
Normal file
15
profiles/full-install/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
let inherit (lib) fileContents;
|
||||
in
|
||||
{
|
||||
imports = [ ../cachix ];
|
||||
|
||||
config = {
|
||||
pub-solar.audio.mopidy.enable = true;
|
||||
pub-solar.audio.bluetooth.enable = true;
|
||||
pub-solar.docker.enable = true;
|
||||
pub-solar.nextcloud.enable = true;
|
||||
pub-solar.office.enable = true;
|
||||
# pub-solar.printing.enable = true; # this is enabled automatically if office is enabled
|
||||
};
|
||||
}
|
|
@ -4,5 +4,4 @@ in
|
|||
{
|
||||
pub-solar.graphical.enable = true;
|
||||
pub-solar.sway.enable = true;
|
||||
pub-solar.social.enable = true;
|
||||
}
|
||||
|
|
11
profiles/pub-solar-iso/default.nix
Normal file
11
profiles/pub-solar-iso/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
let inherit (lib) fileContents;
|
||||
in
|
||||
{
|
||||
imports = [ ../cachix ];
|
||||
config = {
|
||||
pub-solar.graphical.wayland.software-renderer.enable = true;
|
||||
pub-solar.sway.terminal = "foot";
|
||||
pub-solar.x-os.iso-options.enable = true;
|
||||
};
|
||||
}
|
6
profiles/social/default.nix
Normal file
6
profiles/social/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
let inherit (lib) fileContents;
|
||||
in
|
||||
{
|
||||
pub-solar.social.enable = true;
|
||||
}
|
|
@ -15,6 +15,9 @@ in
|
|||
imports = [ "${extraModulesPath}/git/hooks.nix" ];
|
||||
git = { inherit hooks; };
|
||||
|
||||
# override for our own welcome
|
||||
devshell.name = pkgs.lib.mkForce "PubSolarOS";
|
||||
|
||||
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
|
||||
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
|
||||
# PATH is devshell's exorbitant privilige:
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
{ hmUsers, ... }:
|
||||
{
|
||||
home-manager.users = { inherit (hmUsers) nixos; };
|
||||
|
||||
users.users.nixos = {
|
||||
password = "nixos";
|
||||
description = "default";
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
}
|
19
users/pub-solar/default.nix
Normal file
19
users/pub-solar/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ hmUsers, ... }:
|
||||
{
|
||||
home-manager.users = { inherit (hmUsers) pub-solar; };
|
||||
|
||||
pub-solar = {
|
||||
# These are your personal settings
|
||||
# The only required settings are `name` and `password`,
|
||||
# for convenience, use publicKeys to add your SSH keys
|
||||
# The rest is used for programs like git
|
||||
user = {
|
||||
name = "pub-solar";
|
||||
# default password = pub-solar
|
||||
password = "$6$Kv0BCLU2Jg7GN8Oa$hc2vERKCbZdczFqyHPfgCaleGP.JuOWyd.bfcIsLDNmExGXI6Rnkze.SWzVzVS311KBznN/P4uUYAUADXkVtr.";
|
||||
fullName = "Pub Solar";
|
||||
email = "iso@pub.solar";
|
||||
publicKeys = [ ];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue