Compare commits

..

8 Commits

Author SHA1 Message Date
3d535d13c0 hippocampus: Allow hydra build riscv 2024-07-12 00:04:02 -04:00
2f588ab322 Merge branch 'main' of https://git.syzygial.cc/Syzygial/NixMachines 2024-07-11 23:59:43 -04:00
a46014bab7 PinetabV: catch2 & registry fix 2024-07-12 03:55:12 +00:00
119d74c888 universedesktop: vesktop & obs 2024-07-11 23:20:13 -04:00
7e31efd385 universedesktop: wlroots portal 2024-07-11 23:20:12 -04:00
2b7a1bd25d Pinetab-v: rope in config 2024-07-11 23:20:12 -04:00
8f657ef0de Hippocampus: Remove Unused Deploy Machines
TODO: Replace the deployment with microvms similar to how it's
implemented in https://gitea.c3d2.de/c3d2
2024-07-09 15:59:58 -04:00
57dc4e26a5 Hippocampus: RISC-V typo 2024-07-07 11:48:12 -04:00
104 changed files with 1141 additions and 2305 deletions

330
flake.lock generated
View File

@@ -1,51 +1,38 @@
{
"nodes": {
"deploy-rs": {
"emacs-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"utils": "utils"
"flake-utils": "flake-utils",
"nixpkgs": [
"me-emacs",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1762286984,
"narHash": "sha256-9I2H9x5We6Pl+DBYHjR1s3UT8wgwcpAH03kn9CqtdQc=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "9c870f63e28ec1e83305f7f6cb73c941e699f74f",
"lastModified": 1692037570,
"narHash": "sha256-bvj/wfLLFTc8cWAwhN8tgShiy8ekPWt1+gWlEH7W4zY=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "7a4b5bbc06182e2f704630cd77a614ab0d9c2f2e",
"type": "github"
},
"original": {
"owner": "serokell",
"repo": "deploy-rs",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"owner": "nix-community",
"repo": "emacs-overlay",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
@@ -56,14 +43,14 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
@@ -72,39 +59,6 @@
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakey-profile": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -112,11 +66,11 @@
]
},
"locked": {
"lastModified": 1762458864,
"narHash": "sha256-O8NI0pOf1GxPaBRhyspWZmtXLo0tzEEvOfMxNh3/8Jo=",
"lastModified": 1718526747,
"narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f35d0cb75f0669ac8de18d774b336d3d3560bcde",
"rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792",
"type": "github"
},
"original": {
@@ -125,54 +79,20 @@
"type": "github"
}
},
"lix": {
"flake": false,
"locked": {
"lastModified": 1737234286,
"narHash": "sha256-CCKIAE84dzkrnlxJCKFyffAxP3yfsOAbdvydUGqq24g=",
"rev": "2837da71ec1588c1187d2e554719b15904a46c8b",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2837da71ec1588c1187d2e554719b15904a46c8b.tar.gz?rev=2837da71ec1588c1187d2e554719b15904a46c8b"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/2.92.0.tar.gz"
}
},
"lix-module": {
"inputs": {
"flake-utils": "flake-utils",
"flakey-profile": "flakey-profile",
"lix": "lix",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1737237494,
"narHash": "sha256-YMLrcBpf0TR5r/eaqm8lxzFPap2TxCor0ZGcK3a7+b8=",
"rev": "b90bf629bbd835e61f1317b99e12f8c831017006",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/b90bf629bbd835e61f1317b99e12f8c831017006.tar.gz?rev=b90bf629bbd835e61f1317b99e12f8c831017006"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz"
}
},
"me-emacs": {
"inputs": {
"emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1757014957,
"narHash": "sha256-iPw1uXPUb4mPSZ/Uneop+1veSN5fEYCrsJwq71zLADs=",
"lastModified": 1718551485,
"narHash": "sha256-rIAQivtFw0YN3i3xAeBEpCcErA1KGD/IxV7c2VaKIJ8=",
"ref": "refs/heads/master",
"rev": "71bb31643363b4a42948505d41f4e1c83a21c868",
"revCount": 88,
"rev": "3ac7b61c9f476746489938d708309b7e69eeafd4",
"revCount": 61,
"type": "git",
"url": "https://git.syzygial.cc/Syzygial/EmacsConfig.git"
},
@@ -181,28 +101,6 @@
"url": "https://git.syzygial.cc/Syzygial/EmacsConfig.git"
}
},
"microvm": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
],
"spectrum": "spectrum"
},
"locked": {
"lastModified": 1762200934,
"narHash": "sha256-Bv4ZKRPsIc6W7qF1I2fevxFETqRNuG3XOsiRIfJ7YlQ=",
"owner": "astro",
"repo": "microvm.nix",
"rev": "1d05a3c26dbb9d4b1cd644e10713a70d8740cb6a",
"type": "github"
},
"original": {
"owner": "astro",
"repo": "microvm.nix",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
@@ -210,11 +108,11 @@
]
},
"locked": {
"lastModified": 1762304480,
"narHash": "sha256-ikVIPB/ea/BAODk6aksgkup9k2jQdrwr4+ZRXtBgmSs=",
"lastModified": 1718662658,
"narHash": "sha256-AKG7BsqtVWDlefgzyKz7vjaKTLi4+bmTSBhowbQoZtM=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "b8c7ac030211f18bd1f41eae0b815571853db7a2",
"rev": "29b3096a6e283d7e6779187244cb2a3942239fdf",
"type": "github"
},
"original": {
@@ -224,29 +122,29 @@
"type": "github"
}
},
"nixpkgs": {
"nixos-hardware": {
"locked": {
"lastModified": 1743014863,
"narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f",
"lastModified": 1720158314,
"narHash": "sha256-QNEOk6xmw3ct7P70wKzkGoqeb5gyJWEFdw7AZIul9V4=",
"owner": "CyborgPotato",
"repo": "nixos-hardware",
"rev": "c905e5bf25f9eab4cd3e014d3157fa3a62c3a5b6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"owner": "CyborgPotato",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs": {
"locked": {
"lastModified": 1762111121,
"narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=",
"lastModified": 1718530797,
"narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4",
"rev": "b60ebf54c15553b393d144357375ea956f89e9a9",
"type": "github"
},
"original": {
@@ -256,13 +154,61 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs-stable": {
"locked": {
"lastModified": 1760596604,
"narHash": "sha256-J/i5K6AAz/y5dBePHQOuzC7MbhyTOKsd/GLezSbEFiM=",
"lastModified": 1691950488,
"narHash": "sha256-iUNEeudc4dGjx+HsHccnGiuZUVE/nhjXuQ1DVCsHIUY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3cbe716e2346710d6e1f7c559363d14e11c32a43",
"rev": "720e61ed8de116eec48d6baea1d54469b536b985",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1720553833,
"narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_3": {
"locked": {
"lastModified": 1718478900,
"narHash": "sha256-v43N1gZLcGkhg3PdcrKUNIZ1L0FBzB2JqhIYEyKAHEs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c884223af91820615a6146af1ae1fea25c107005",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1718276985,
"narHash": "sha256-u1fA0DYQYdeG+5kDm1bOoGcHtX0rtC7qs2YA2N1X++I=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3f84a279f1a6290ce154c5531378acc827836fbb",
"type": "github"
},
"original": {
@@ -274,26 +220,26 @@
},
"root": {
"inputs": {
"deploy-rs": "deploy-rs",
"home-manager": "home-manager",
"lix-module": "lix-module",
"me-emacs": "me-emacs",
"microvm": "microvm",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs_2",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable_2",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_3"
},
"locked": {
"lastModified": 1760998189,
"narHash": "sha256-ee2e1/AeGL5X8oy/HXsZQvZnae6XfEVdstGopKucYLY=",
"lastModified": 1718506969,
"narHash": "sha256-Pm9I/BMQHbsucdWf6y9G3xBZh3TMlThGo4KBbeoeczg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "5a7d18b5c55642df5c432aadb757140edfeb70b3",
"rev": "797ce4c1f45a85df6dd3d9abdc53f2691bea9251",
"type": "github"
},
"original": {
@@ -302,22 +248,6 @@
"type": "github"
}
},
"spectrum": {
"flake": false,
"locked": {
"lastModified": 1759482047,
"narHash": "sha256-H1wiXRQHxxPyMMlP39ce3ROKCwI5/tUn36P8x6dFiiQ=",
"ref": "refs/heads/main",
"rev": "c5d5786d3dc938af0b279c542d1e43bce381b4b9",
"revCount": 996,
"type": "git",
"url": "https://spectrum-os.org/git/spectrum"
},
"original": {
"type": "git",
"url": "https://spectrum-os.org/git/spectrum"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@@ -347,54 +277,6 @@
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",

162
flake.nix
View File

@@ -1,6 +1,8 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
nixos-hardware.url = "github:CyborgPotato/nixos-hardware/master";
sops-nix.url = "github:Mic92/sops-nix";
me-emacs.url = "git+https://git.syzygial.cc/Syzygial/EmacsConfig.git";
me-emacs.inputs.nixpkgs.follows = "nixpkgs";
@@ -8,118 +10,94 @@
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
};
outputs = { self, nixpkgs, sops-nix, me-emacs, nix-darwin, home-manager, lix-module, microvm, deploy-rs }@inputs: let
overlays = import ./overlays/default.nix inputs;
modules = import ./modules/default.nix inputs;
outputs = { self, nixpkgs, nixpkgs-stable, nixos-hardware, sops-nix, me-emacs, nix-darwin, home-manager }@attrs: let
hydraGitea = import ./overlays/hydra.nix;
nvidiaContainer = import ./overlays/nvidiacontainer.nix nixpkgs;
me-emacs-overlay = me-emacs.overlays.default;
overlays' = l: ({ config, pkgs, ... }: {
nixpkgs.overlays = l;
});
# Configuration for `nixpkgs`
nixpkgsConfig = {
config = { allowUnfree = true; };
};
pkgs_linux-x86_64 = nixpkgs.legacyPackages."x86-linux";
pkgs_linux-aarch64 = nixpkgs.legacyPackages."aarch64-linux";
sysConfig = config: {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
} // config;
nixosSystem' = config: nixpkgs.lib.nixosSystem (sysConfig ({
} // config));
darwinSystem' = config: nix-darwin.lib.darwinSystem (sysConfig ({
system = "aarch64-darwin";
} // config));
homeConf' = config: home-manager.lib.homeManagerConfiguration config;
in {
nixosConfigurations = {
nixos = nixosSystem' {
modules =[
./machines/hippocampus/configuration.nix
(overlays' [
overlays.nvidiaContainer
])
modules.sops
({ pkgs, ...}: {
nix.package = pkgs.lix;
})
];
nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules =
[
({ config, pkgs, ... }: {
nixpkgs.overlays = [ hydraGitea nvidiaContainer ];
})
./machines/hippocampus/configuration.nix
sops-nix.nixosModules.sops
];
};
universedesktop = nixosSystem' {
modules = [
./machines/universedesktop/configuration.nix
(overlays' [
overlays.emacs
])
modules.sops
# Broken w/ this nixpkgs input
# lix-module.nixosModules.default
];
universedesktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules =
[
({ config, pkgs, ... }: {
nixpkgs.overlays = [ me-emacs-overlay ];
})
./machines/universedesktop/configuration.nix
sops-nix.nixosModules.sops
];
};
pericyte = nixosSystem' {
modules = [
./machines/pericyte/configuration.nix
modules.sops
# lix-module.nixosModules.default
# microvm.nixosModules.host
];
};
};
darwinConfigurations = {
UniverseAir = darwinSystem' {
modules = [
./machines/universeair/configuration.nix
(overlays' [
overlays.emacs
])
modules.home-manager-darwin
# lix-module.nixosModules.default
];
};
};
homeConfigurations = {
universelaptop = homeConf' {
pkgs = pkgs_linux-aarch64;
extraSpecialArgs = {
pkgs-x86_64 = pkgs_linux-x86_64;
inputs = inputs;
ptv = let
patch-8gb = {
hardware.deviceTree.overlays = [{
name = "8GB-patch";
dtsFile = "${nixos-hardware}/pine64/pinetab-v/star64-8GB.dts";
}];
};
in nixpkgs-stable.lib.nixosSystem {
specialArgs = {
inputs = attrs;
};
modules = [
./machines/asahi/home.nix
./machines/ptv/configuration.nix
patch-8gb
];
};
};
darwinConfigurations."UniverseAir" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inputs = attrs;
};
modules = [
./machines/universeair/configuration.nix
({ config, pkgs, ... }: {
nixpkgs.overlays = [ me-emacs-overlay ];
})
home-manager.darwinModules.home-manager
{
nixpkgs = nixpkgsConfig;
}
];
};
homeConfigurations."universelaptop" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs_linux-aarch64;
deploy = {
nodes = {
pericyte = {
hostname = "opcp";
sshUser = "root";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.pericyte;
};
};
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [ ./machines/asahi/home.nix ];
extraSpecialArgs = {
pkgs-x86_64 = pkgs_linux-x86_64;
inputs = attrs;
};
};
# This is highly advised, and will prevent many possible mistakes
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
hydraJobs = {
# inherit (me-emacs) packages;
PinetabV = self.nixosConfigurations.ptv.config.system.build.toplevel;
};
};
}

View File

@@ -1,24 +1,6 @@
{ pkgs, config, ... }: {
{ ... }: {
services.gitea.dump = {
enable = true;
interval = "2:45";
};
systemd.timers."gitea-clear-dump" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "gitea-clear-dump.service";
};
};
systemd.services."gitea-clear-dump" = {
script = ''
${pkgs.findutils}/bin/find /var/lib/gitea/dump -type f -ctime +5 -exec rm -f {} \;
'';
serviceConfig = {
Type = "oneshot";
User = config.services.gitea.user;
};
};
}

View File

@@ -46,9 +46,6 @@
options = "--delete-older-than 30d";
};
nix.settings.auto-optimise-store = true;
nix.settings.trusted-users = [
"server"
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
@@ -74,21 +71,21 @@
# Enable the X11 windowing system.
services.xserver.enable = true;
# services.xserver.displayManager.sddm.enable = true;
# services.xserver.desktopManager.plasma5.enable = true;
# Enable the Pantheon Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "us";
variant = "";
};
layout = "us";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
@@ -117,8 +114,8 @@
};
# Enable automatic login for the user.
# services.xserver.displayManager.autoLogin.enable = true;
# services.xserver.displayManager.autoLogin.user = "server";
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "server";
# List packages installed in system profile. To search, run:
# $ nix search wget

View File

@@ -68,7 +68,7 @@ let
partOf = ["headscale.service"];
script = ''
${pkgs.bash}/bin/bash -c '${cfg.package}/bin/headscale users create ${name} || true'
${cfg.package}/bin/headscale users create ${name}
'';
serviceConfig = {
@@ -91,7 +91,7 @@ let
partOf = ["headscale.service"];
script = ''
${cfg.package}/bin/headscale preauthkeys -u $(${cfg.package}/bin/headscale users -o json-line list | ${pkgs.jq}/bin/jq '.[] | select(.name=="${name}").id') create \
${cfg.package}/bin/headscale preauthkeys -u ${name} create \
${lib.optionalString options.preAuthEphemeral "--ephemeral"} \
${lib.optionalString options.preAuthReusable "--reusable"} \
--expiration ${options.preAuthExpiration} \

View File

@@ -6,7 +6,7 @@
nixpkgs.config.nvidia.acceptLicense = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.graphics.enable = true;
hardware.opengl.enable = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470;

View File

@@ -1,5 +0,0 @@
FROM alpine:3.16
RUN apk add --no-cache bash wireguard-tools jq curl git ncurses
RUN git clone https://github.com/pia-foss/manual-connections /manual-connections
WORKDIR /manual-connections
CMD bash -c "/manual-connections/run_setup.sh && watch -n 60 curl ip.me"

View File

@@ -18,12 +18,10 @@
in {
containers = {
wireguard = {
# Derived from the pia-wg.tar.gz
# which was built from the containerfile
image = "localhost/pia-wg:latest";
image = "thrnz/docker-wireguard-pia";
volumes = [
# "${configDir}/wireguard:/config"
# "${configDir}/wireguard_pia:/pia"
"${configDir}/wireguard_pia:/pia"
];
ports = getPorts [
"deluge"
@@ -36,23 +34,13 @@
];
environment = {
TZ = "America/Toronto";
LOC = "ca";
PIA_DNS = "false"; # - true/false
PIA_PF = "false"; # - true/false
PIA_CONNECT = "true"; # - true/false; connect to VPN after configuration has been created. Set to false to only create configuration file. Only effective for wireguard protocol. Default true.
MAX_LATENCY = "0.2"; # - numeric value, in seconds
AUTOCONNECT = "true"; # - true/false; this will test for and select the server with the lowest latency, it will override PREFERRED_REGION
# PREFERRED_REGION = ""; # - the region ID for a PIA server
DIP_TOKEN = "n";
VPN_PROTOCOL = "wireguard"; # - wireguard or openvpn; openvpn will default to openvpn_udp_standard, but can also specify openvpn_tcp/udp_standad/strong
DISABLE_IPV6 = "no"; # - yes/no
LOC = "ca";
};
extraOptions = [
"--privileged" "--dns=1.1.1.1"
"--cap-add=ALL"
"--pull=newer"
"--dns=1.1.1.1"
"--env-file=${config.sops.secrets.jellyfin-pia.path}"
"--cap-add=NET_ADMIN,NET_RAW,SYS_MODULE"
"--cap-drop=MKNOD,AUDIT_WRITE"
"--sysctl=net.ipv4.ip_forward=1"
"--sysctl=net.ipv4.conf.all.src_valid_mark=1"
"--sysctl=net.ipv6.conf.lo.disable_ipv6=1"
"--sysctl=net.ipv6.conf.all.disable_ipv6=1"

View File

@@ -2,5 +2,4 @@
boot.binfmt.emulatedSystems = [
"riscv64-linux"
];
boot.binfmt.preferStaticEmulators = true;
}

View File

@@ -1,8 +1,7 @@
nextcloud:
adminPass: ENC[AES256_GCM,data:D2SAD/Somvw8abIm0KX4fWRfuQ==,iv:Y7K14yZZFcu97KVBd0219hwnGY4LEX2DNxxulSegr/8=,tag:aRJAlz1xvQxWodcE2bZLdQ==,type:str]
s3secret: ENC[AES256_GCM,data:lIVuiZMh376MSuu13UPCu49Q64bVbk+WM/CUEIGzV0Q=,iv:J2vHalppWEupWK07zXsMoiH6avmpsgg0Cqcc7EkZVV4=,tag:pxKwiaH5SZa8Vh71gLGQWw==,type:str]
jellyfin-pia: ENC[AES256_GCM,data:hOgUAr47FMd2QgzgXBeqv41Paqy6zn6tyWVDbF1JtqcTog/zZC4=,iv:opnxrycFszAhuMARcP48gKF6eL1ERNgWS68wO+s4CIM=,tag:fqimxKdTAh55ANKD3bp46w==,type:str]
ddclient: ENC[AES256_GCM,data:a31MKnoEZXrj/s8z3+MP9jhQ5/sBjljZphXBJsWj5GU=,iv:YHKCartadDQa59aUf9Fw/KgdgMgsqsVLDAIh/KeqehQ=,tag:hUaUqjcX75xw6eC9axtQmw==,type:str]
jellyfin-pia: ENC[AES256_GCM,data:rbqpmm2EtxcMeJfjlGaJOwPCn4UAZaKsH8Zeztk7A6QiSw==,iv:8A6NHVHgKIL6iwLKgRrT6T3k0pgDI5lL5rDMN5/Egrw=,tag:P6Kh9cOnrB23Z7S72xBK7g==,type:str]
anki: ENC[AES256_GCM,data:hUBKr/s1DDorlmbHDUvHtVSumw==,iv:Ekjt6dsncinHhM+dV/mxOjErBQpgKtPOVbmwGRy9XOE=,tag:zvfV9z3QROgsk4eznmxqDw==,type:str]
tandoor-secret: ENC[AES256_GCM,data:/clEIU38M7lJ6+JbFSKWb5kKSUvxdGYPq2Hl9TjgijZtYIYFOleJQ9PiT+d/osmY/r0=,iv:Nulu93V+s9RBmEDRs2LXJXy7l0O/AeU0CwwtTNLGw2c=,tag:brRyVaWeUGLx1nt0MtcIEw==,type:str]
tandoor-pass: ENC[AES256_GCM,data:Sjz2FuFm3bmqo9z2xckuIHq4qumQ2o/FA09DP7NQtngi,iv:M8BL8enwzGh4cp2hAtee99dC0VDxBvshNBiUp4QCVPQ=,tag:wMifwdLEMw4+M1EO5iywzw==,type:str]
@@ -14,6 +13,10 @@ restic:
passwd: ENC[AES256_GCM,data:vUsAP5+iZo7U55xnUP7Cnk1OxnrO+paHKmT2cuc=,iv:GF7fybEQZIxHPm1Z6Sj5dn/zOR5dRVgikH8LILsTMIs=,tag:Mh61boRPsfHeiSfXmrEx5Q==,type:str]
backblaze: ENC[AES256_GCM,data:IfWzuIYUrCGYpP68CPFi2vLqq9NVmiVyCE+Z8yi+cnaQwgwNL40lJEPL/U3d0lgsmrsV4GheNJ0oQ9tnrrJeBgZgwMl/CwXMctuUHo+cvVot/cNRd1vCdjRr7WUnw8737uxyW45OaaYbkZRa3NWEGDll1iFDWB2w4n5DTsomyO03tFZB5gckwQYmpjYmK4DcIWyTaEiDrznmkyM+sxoWv9pcTHZIIN7TCHHkzmlMzXXqJnoRfCpdVm/QF9jbrAYs,iv:tOa1FFyggm0ScoRdFk6tACOnQVcZMYaDqeJyX5SMKXc=,tag:EY5jQhZnLP6IzqY9garoEQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1crymppz88etsdjpckmtdhr397x5xg5wv8jt6tcj23gt2snq73pzs04fuve
enc: |
@@ -24,7 +27,8 @@ sops:
RVUzMlFya3Z0amdTUTJ5YjFRck5kZzQKoWZzExqzPRpQPL4CdqBalc1/dYtjBH6J
LGR0oImfOWlIJwcaJLv/fc470UvXHHwIji9v/pbV7xMkgMjlJthaYg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-07-19T19:15:37Z"
mac: ENC[AES256_GCM,data:RPGKe5f+5GUnGK3zybRrTnd8N4TprLWBEWLI2HI68Acf1MlJ1AMOWOhpi5xa0Hkxpah8D/d0CEH2ymaO5EBSUamPdYThI4g/4cxNBXboKnALSf91ZUty86/1+14TbI6vFCZ5ghjB4THxszGf47ajIDa/TjHx0yHFWDi7rpApmcw=,iv:ep/NlJfkIkQe5RJ4U2YfZ7/0S4vWqxjg+xrLLnJwfwI=,tag:c01jey2juzoPKux7n/0rug==,type:str]
lastmodified: "2024-06-09T21:13:43Z"
mac: ENC[AES256_GCM,data:wmHB0pgZODb1RL3CBJqQix4V5nES4XpiGJLy8wuuoq20HMQpuE+Ofh4V+px59kJF4bcGyB71OXGlDbPkf3Crz3WJe0UtQjm9qH+c3hlRZMAYCK+5g11ANPUTznjXdCE1JuNWBCu25wYRprDOuPzpr7UZETEHzKBiu2kGI6FajoU=,iv:mhQGGIiSXaaFHLm5mtIyCxjMeHDhv6Sc5fB6cGml2Bo=,tag:BnKHFPK7bhFEp95+9v9SGw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.10.2
version: 3.8.1

View File

@@ -13,15 +13,15 @@
# ./private/grafana.nix
# Home Monitoring and Control
# ./private/homeassistant.nix
./private/homeassistant.nix
# Minio S3 Object Storage
./private/miniio.nix
# OctoPrint
# ./private/octoprint.nix
./private/octoprint.nix
# Samba Share
# ./private/samba.nix
./private/samba.nix
];
}

View File

@@ -6,6 +6,9 @@
# Entrace to Control Pane of Private Network
./public/headscale.nix
# Location tracking of my Dad in Saskatchewan
./public/hauk.nix
# Self Hosted Git Server
./public/gitea.nix
@@ -25,7 +28,7 @@
./public/nextcloud.nix
# Rabb.it at home
# ./public/watchthingz.nix
./public/watchthingz.nix
# Pterodactyl Game Server
./public/pterodactyl.nix
@@ -44,11 +47,5 @@
# Recipe Manager
./public/tandoor.nix
# Random Usage, specific port
./public/random.nix
# Perfect Pitch Project
./public/perfect_pitch.nix
];
}

View File

@@ -4,8 +4,6 @@
sops.secrets.anki = { };
services.anki-sync-server = {
enable = true;
port = 7333;
address = "0.0.0.0";
users = [
{
username = "David";

View File

@@ -35,7 +35,7 @@ in {
services.postgresql = {
enable = true;
settings.port = 5432;
port = 5432;
ensureDatabases = [
"gitea"
];

View File

@@ -0,0 +1,14 @@
{pkgs, config, ...}:
{
imports = [
../../oci/hauk.nix
];
services.caddy.virtualHosts = {
"crompton.cc" = {
extraConfig = ''
reverse_proxy 127.0.0.1:7888
'';
};
};
}

View File

@@ -23,12 +23,9 @@
];
# Give a name to each device
dns = {
dns_config = {
base_domain = "tailnet";
magic_dns = true;
nameservers.global = [
"1.1.1.1"
];
};
};
};

View File

@@ -17,7 +17,7 @@ in {
'';
};
nix.extraOptions = ''
allowed-uris = https://github.com/ https://git.savannah.gnu.org/ https://git.syzygial.cc https://gitlab.com https://sr.ht github: gitlab: https://git.lix.systems
allowed-uris = https://github.com/ https://git.savannah.gnu.org/ https://git.syzygial.cc https://gitlab.com https://sr.ht github: gitlab:
'';
systemd.services.hydra = {
serviceConfig = {
@@ -40,7 +40,7 @@ in {
"riscv64-linux"
];
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
maxJobs = 16;
maxJobs = 8;
}
];
services.caddy.virtualHosts = {

View File

@@ -13,16 +13,17 @@ in {
services.nextcloud = {
enable = true;
package = pkgs.nextcloud32;
package = pkgs.nextcloud28;
hostName = "localhost";
settings = {
extraOptions = {
trusted_domains = [
"cloud.crompton.cc"
"nextcloud.syzygial.cc"
];
trusted_proxies = [
"127.0.0.1"
"cloud.crompton.cc"
"nextcloud.syzygial.cc"
];
overwriteprotocol = "https";
@@ -75,7 +76,7 @@ in {
shell = pkgs.bashInteractive;
packages = with pkgs; [
# generate video thumbnails with preview generator
ffmpeg_7-headless
ffmpeg_5-headless
# required for recognize app
nodejs_20 # runtime and installation requirement
nodejs_20.pkgs.node-pre-gyp # installation requirement
@@ -98,7 +99,7 @@ in {
services.postgresql = {
enable = true;
settings.port = 5432;
port = 5432;
ensureDatabases = [
"nextcloud"
];

View File

@@ -36,7 +36,7 @@
services.postgresql = {
enable = true;
settings.port = 5432;
port = 5432;
ensureDatabases = [
"onlyoffice"
];

View File

@@ -1,52 +0,0 @@
{config, pkgs, ...}:
{
systemd.targets.machines.enable = true;
systemd.services."perfectpitch-container" = {
enable = true;
wantedBy = ["machines.target"];
environment = {
# SYSTEMD_NSPAWN_USE_CGNS = "0";
};
script = ''
exec ${config.systemd.package}/bin/systemd-nspawn --hostname perfectpitch \
--resolv-conf=off --system-call-filter="add_key keyctl bpf" --bind /dev/fuse \
-nbD /var/lib/machines/perfectpitch --machine perfectpitch
'';
postStart = ''
${pkgs.iproute2}/bin/ip link set ve-perfectpitch up || true
${pkgs.iproute2}/bin/ip addr add 10.2.0.0 dev ve-perfectpitch || true
${pkgs.iproute2}/bin/ip route add 10.2.0.1 dev ve-perfectpitch || true
'';
serviceConfig = {
Type = "notify";
Slice = "machine.slice";
Delegate = true;
DeviceAllow = "/dev/fuse rwm";
};
};
networking.nat = {
enable = true;
# Check for hostBridge use vb instead of ve
internalInterfaces = ["ve-perfectpitch"];
externalInterface = "enp0s25";
enableIPv6 = true;
forwardPorts = [
{ sourcePort = 8022;
destination = "10.2.0.1:22";
proto = "tcp";
}
{ sourcePort = 8022;
destination = "10.2.0.1:22";
proto = "udp";
}
];
};
services.caddy.virtualHosts = {
"pitch.crompton.cc" = {
extraConfig = ''
reverse_proxy 10.2.0.1:8080
'';
};
};
}

View File

@@ -32,11 +32,11 @@
externalInterface = "enp0s25";
enableIPv6 = true;
forwardPorts = [
{ sourcePort = "25565:26000";
{ sourcePort = "25565:28000";
destination = "10.1.0.1:25565-25600";
proto = "tcp";
}
{ sourcePort = "25565:26000";
{ sourcePort = "25565:28000";
destination = "10.1.0.1:25565-25600";
proto = "udp";
}
@@ -52,17 +52,11 @@
};
services.caddy.virtualHosts = {
"games.syzygial.cc:443" = {
serverAliases = [
"games.crompton.cc:443"
];
extraConfig = ''
reverse_proxy 10.1.0.1:80
'';
};
"games.syzygial.cc:9000" = {
serverAliases = [
"games.crompton.cc:9000"
];
extraConfig = ''
reverse_proxy 10.1.0.1:9000
'';

View File

@@ -1,9 +0,0 @@
{ config, pkgs, lib, ... }: {
services.caddy.virtualHosts = {
"pitch.syzygial.cc" = {
extraConfig = ''
reverse_proxy 127.0.0.1:7123
'';
};
};
}

View File

@@ -10,12 +10,5 @@
}
'';
};
"crompton.cc" = {
extraConfig = ''
file_server {
root /srv/www/crompton
}
'';
};
};
}

View File

@@ -18,8 +18,6 @@ in {
};
systemd.services.tandoor-recipes = {
# https://github.com/TandoorRecipes/recipes/issues/3617
environment.GUNICORN_MEDIA = "1"; #lib.mkForce null;
serviceConfig = {
EnvironmentFile = config.sops.secrets.tandoor-pass.path;
};
@@ -27,7 +25,7 @@ in {
services.postgresql = {
enable = true;
settings.port = 5432;
port = 5432;
ensureDatabases = [
tandoor_user
];

View File

@@ -16,7 +16,7 @@
};
services.postgresql = {
enable = true;
settings.port = 5432;
port = 5432;
ensureDatabases = [
"vaultwarden"
];

View File

@@ -1,7 +1,4 @@
{ config, pkgs, lib, ... }: {
users.users.webdav = {
shell = pkgs.bashInteractive;
};
sops.secrets.webdav = {
owner = config.services.webdav.user;
};

View File

@@ -1,6 +1,5 @@
{
imports = [
./services/tailscale.nix
./services/dyndns.nix
];
}

View File

@@ -1,14 +0,0 @@
{ config, pkgs, lib, ... }: {
sops.secrets.ddclient = {};
services.ddclient = {
enable = true;
usev4 = "webv4, web=dynamicdns.park-your-domain.com/getip";
protocol = "namecheap";
server = "dynamicdns.park-your-domain.com";
username = "crompton.cc";
passwordFile = config.sops.secrets.ddclient.path;
domains = [
"@"
];
};
}

View File

@@ -1,29 +0,0 @@
{ pkgs, inputs, ... }: {
imports = [
./hardware-configuration.nix
"${inputs.nixpkgs}/nixos/modules/profiles/headless.nix"
"${inputs.nixpkgs}/nixos/modules/profiles/minimal.nix"
./podman.nix
./container-registry.nix
# ./microvm-configuration.nix
# ./k3s.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = with pkgs; [
git
btop
tmux
oci-cli
];
boot.tmp.cleanOnBoot = true;
# zramSwap.enable = true;
networking.hostName = "pericyte";
networking.domain = "";
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOaNNSV/wurGA8D7bT+WX4UlHdKqd9SFfVXvSalvHag5qYDPUIsGGkqSNj1dcong9qxrC8y7G7ybWhwRKTKXInXrq6EO4JkVkCSbVqrq8gIv66upsKltvmf0esiOdrpRgHoiup8JKaX93aUT27rykReT39mFwkJZDoD4ViNiK7QmbgDC/9pyGDSJykreSnBoxtczox8Zi+pwN8XMI4nRVdV9hppXMpj38/O3Qaq+oXdHJ2MVNy9D+TqxYofstFbzpJpEb2xA4QYnq/VVJFk8VaZlg3qxelwBJ1GNZO8TMkLA+6b07D3aISyEIQAONviNktPwRPiw903hsDyeKDunDx ssh-key-2025-03-31'' ];
system.stateVersion = "25.05";
}

View File

@@ -1,6 +0,0 @@
{ pkgs, ... }: {
services.dockerRegistry = {
enable = true;
package = pkgs.distribution;
};
}

View File

@@ -1,18 +0,0 @@
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
fileSystems."/boot" = { device = "/dev/disk/by-uuid/FCE4-1F46"; fsType = "vfat"; };
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
swapDevices = [
{
device = "/swapfile";
}
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
}

View File

@@ -1,22 +0,0 @@
{ pkgs, ... }: {
networking.firewall = {
allowedTCPPorts = [
6443 # k3s: required so that pods can reach the API server (running on port 6443 by default)
# 2379 # k3s, etcd clients: required if using a "High Availability Embedded etcd" configuration
# 2380 # k3s, etcd peers: required if using a "High Availability Embedded etcd" configuration
];
allowedUDPPorts = [
# 8472 # k3s, flannel: required if using multi-node for inter-node networking
];
};
services.k3s = {
enable = true;
role = "server";
extraFlags = toString [
# "--debug" # Optionally add additional args to k3s
];
};
environment.systemPackages = with pkgs; [
rancher
];
}

View File

@@ -1,6 +0,0 @@
{ pkgs, ... }: {
microvm.autostart = [
"vm-starbot"
"vm-starbot-dev"
];
}

View File

@@ -1,21 +0,0 @@
{ pkgs, ... }: {
# Enable common container config files in /etc/containers
virtualisation.containers.enable = true;
virtualisation = {
podman = {
enable = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
};
# Useful other development tools
environment.systemPackages = with pkgs; [
dive # look into docker image layers
skopeo # Inspect images
podlet # create quadlets (systemd units)
podman-tui # status of containers in the terminal
podman-compose # start group of containers for dev
];
}

View File

@@ -1,32 +0,0 @@
{ pkgs, ... }: {
users.groups.peertube = { };
users.users.peertube = {
isSystemUser = true;
group = "peertube";
home = "/var/lib/peertube";
createHome = true;
uid = 2342;
subUidRanges = [
{
count = 65536;
startUid = 2147483646;
}
];
subGidRanges = [
{
count = 65536;
startGid = 2147483647;
}
];
};
virtualisation.oci-containers = {
backend = "podman";
# containers.peertube = {
# image = "chocobozzz/peertube:latest";
# ports = [ ];
# podman = {
# user = "peertube";
# };
# };
};
}

42
machines/ptv/ccache.nix Normal file
View File

@@ -0,0 +1,42 @@
{ config, pkgs, lib, inputs, ... }: {
programs.ccache.enable = true;
programs.ccache.cacheDir = "/opt/ccache";
nix.settings.extra-sandbox-paths = [ "/opt/ccache" ];
nixpkgs.overlays = [
(self: super: {
ccacheWrapper = super.ccacheWrapper.override {
# TODO: Sloppiness random_seed apart of wrapper
extraConfig = ''
export CCACHE_COMPRESS=1
export CCACHE_DIR="${config.programs.ccache.cacheDir}"
export CCACHE_UMASK=007
if [ ! -d "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' does not exist"
echo "Please create it with:"
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
echo " sudo chown root:nixbld '$CCACHE_DIR'"
echo "====="
exit 1
fi
if [ ! -w "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
echo "Please verify its access permissions"
echo "====="
exit 1
fi
'';
};
linux-ptv-ccache = pkgs.callPackage "${inputs.nixos-hardware}/pine64/pinetab-v/linux-5.15.nix" {
argsOverride = {
stdenv = self.ccacheStdenv;
};
};
})
];
programs.ccache.packageNames = [ "ffmpeg" "firefox-unwrapped" "tmux" ];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-ptv-ccache;
}

View File

@@ -0,0 +1,91 @@
{ lib, pkgs, config, inputs, ... }: let
inherit (pkgs.checkpointBuildTools) prepareCheckpointBuild mkCheckpointBuild;
linux-cached = prepareCheckpointBuild pkgs.linux-ptv;
linux-changed = pkgs.linux-ptv;
linux-ptv = pkgs.checkpointBuildTools.mkCheckpointBuild linux-changed linux-cached;
in {
# boot.kernelPackages = pkgs.linuxPackagesFor linux-ptv;
boot.kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0" ];
systemd.services."getty@tty0".enable = lib.mkDefault true;
systemd.services."getty@tty0".wantedBy = lib.mkDefault [ "getty.target" ];
system.stateVersion = "24.05";
nixpkgs.hostPlatform = "riscv64-linux";
networking.hostName = "ptv";
nix.registry.nixpkgs.flake = inputs.nixpkgs-stable;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.overlays = [
(final: prev: {
# https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel
# Source of different firmware/3rd party sw and fw
img-rogue-firmware = pkgs.stdenv.mkDerivation {
pname = "img-gpu-powervr";
version = "36-working-on-it";
src = ./rgx-img-gpu-firmware.tar.gz;
dontBuild = true;
passthru = {
compressFirmware = false;
};
installPhase = ''
runHook preInstall
mkdir -p $out/lib/firmware
cp * $out/lib/firmware
runHook postInstall
'';
};
})
(import ./pkgs)
];
imports = [
"${inputs.nixos-hardware}/pine64/pinetab-v/sd-image.nix"
# ./ccache.nix
./native-bootstrap.nix
];
users.users = {
pine64 = {
isNormalUser = true;
extraGroups = [ "wheel" ];
initialHashedPassword = "$y$j9T$cuXgVIPt3n1.v7GcoXiql1$4EBlHM7sYO.lL.DTDwQzTBqSYsD01WIDZQXleCeozl8";
};
root = {
initialHashedPassword = "$y$j9T$cuXgVIPt3n1.v7GcoXiql1$4EBlHM7sYO.lL.DTDwQzTBqSYsD01WIDZQXleCeozl8";
};
};
networking.wireless.enable = true;
networking.wireless.userControlled.enable = true;
#programs.hyprland = {
# Install the packages from nixpkgs
# enable = true;
# Whether to enable XWayland
# xwayland.enable = true;
#};
environment.systemPackages = with pkgs; [
dropbear
busybox
tmux
git
weston
# ffmpeg
# firefox
];
hardware.firmware = pkgs.lib.mkOrder 1000 [
pkgs.img-rogue-firmware
];
services.openssh.enable = true;
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,37 @@
{ config, pkgs, lib, ...}: let
stdenvStages = curStage:
[ curStage ]
++
(if curStage.hasCC
then [curStage.cc] ++ (stdenvStages curStage.__bootPackages.stdenv)
else []);
in {
system.includeBuildDependencies = true;
system.extraDependencies = with pkgs;
lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform)
((stdenvStages stdenv) ++ [
stdenvNoCC
clangStdenv
clangStdenv.cc
clang
libllvm
gcc
rustc
cargo
coreutils
curl
wget
python3
# Other common build tools
zip
unzip
cmake
meson
bison
perl
zlib
busybox
xz
binutils
]);
}

View File

@@ -0,0 +1,17 @@
final: prev: prev.argyllcms.overrideAttrs (old: {
postInstall = (prev.lib.optional (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) ''
cp imdi/imdi_make $out/bin
cp gamut/GenRMGam $out/bin
'');
patches = (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
./imdi_make.patch
]);
preBuild = (prev.lib.optional (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) ''
cd imdi; imdi_make; cd ..
cd gamut; GenRMGam; cd ..
'');
# Need to use build version of imdi_make && host version for output
depsBuildBuild = (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
prev.buildPackages.argyllcms
]);
})

View File

@@ -0,0 +1,39 @@
diff --git a/gamut/Jamfile b/gamut/Jamfile
index e97d0df..adc259f 100755
--- a/gamut/Jamfile
+++ b/gamut/Jamfile
@@ -47,7 +47,7 @@ Main GenRMGam : GenRMGam.c ;
# Generate referenec medium gamut the kernel files
# (NoUpdate so that Cross Compile Win64 hack works)
NNoUpdate RefMediumGamut.gam ;
-GenFile RefMediumGamut.gam : GenRMGam ;
+# GenFile RefMediumGamut.gam : GenRMGam ;
# Visual gamut
Main GenVisGam : GenVisGam.c ;
diff --git a/imdi/Jamfile b/imdi/Jamfile
index 79b27fb..64c3348 100755
--- a/imdi/Jamfile
+++ b/imdi/Jamfile
@@ -41,7 +41,7 @@ LINKLIBS = ../numlib/libnum ;
# GenFile source.c : program args ; make custom file
# Generate all the kernel files
-GenFileND imdi_k.h : imdi_make $(IMDI_MAKE_OPT) -d [ NormPaths $(DOT) ] ;
+# GenFileND imdi_k.h : imdi_make $(IMDI_MAKE_OPT) -d [ NormPaths $(DOT) ] ;
# imdi library
Library libimdi : imdi.c imdi_tab.c ;
diff --git a/imdi/Makefile b/imdi/Makefile
index 5523893..2048875 100755
--- a/imdi/Makefile
+++ b/imdi/Makefile
@@ -48,7 +48,7 @@ imdi_gen$(SUFOBJ): imdi_gen.c imdi_utl.h imdi_arch.h imdi_gen.h
# Generate the kernel files
imdi_k.h imdi_k.c : imdi_make$(SUFEXE)
- .$(SLASH)imdi_make$(SUFEXE)
+ imdi_make$(SUFEXE)
# imdi runtime library

View File

@@ -0,0 +1,4 @@
final: prev: prev.bundlerApp.override (old: {
ruby = final.buildPackages.ruby;
callPackage = final.newScope { ruby = final.buildPackages.ruby; };
})

View File

@@ -0,0 +1,3 @@
final: prev: prev.cryptsetup.overrideAttrs (old: {
doCheck = false;
})

View File

@@ -0,0 +1,19 @@
(final: prev: {
discount = (import ./discount) final prev;
fwupd-efi = (import ./fwupd-efi) final prev;
live555 = (import ./live555) final prev;
protobuf = (import ./protobuf) final prev;
bundlerApp = (import ./bundlerApp) final prev;
vulkan-tools = (import ./vulkan-tools) final prev;
libdrm = (import ./libdrm) final prev;
valgrind = (import ./valgrind) final prev;
valgrind-light = final.valgrind.override { gdb = null; };
argyllcms = (import ./argyllcms) final prev;
gn = (import ./gn) final prev;
openfortivpn = (import ./openfortivpn) final prev;
vpnc = (import ./vpnc) final prev;
# perl538Packages.Testutf8 = (import ./perlTestutf8) final prev;
diffutils = (import ./diffutils) final prev;
gnugrep = (import ./gnugrep) final prev;
cryptsetup = (import ./cryptsetup) final prev;
})

View File

@@ -0,0 +1,4 @@
final: prev: prev.diffutils.overrideAttrs (old: {
doCheck = false; #prev.stdenv.hostPlatform != "riscv64-linux";
})

View File

@@ -0,0 +1,23 @@
#include <stdio.h>
int
main(argc, argv)
int argc;
char **argv;
{
char *p;
if (argc != 3)
return 1;
printf("s;@%s@;", argv[1]);
for (p=argv[2]; *p; ++p) {
if ( *p == ';' )
putchar('\\');
putchar(*p);
}
puts(";g");
return 0;
}

View File

@@ -0,0 +1,67 @@
diff --git a/configure.inc b/configure.inc
index fd0c9ba..98066d5 100755
--- a/configure.inc
+++ b/configure.inc
@@ -1733,52 +1733,6 @@ AC_FAIL() {
$__fail 1
}
-#
-# __ac_config_sed; a C program to do escaping for AC_SUB
-__ac_config_sed() {
-
-
- test -x config.sed && return
-
- echo "generating config.sed"
-
- AC_PROG_CC
-
-cat > ngc$$.c << \EOF
-#include <stdio.h>
-
-int
-main(argc, argv)
-int argc;
-char **argv;
-{
- char *p;
-
- if (argc != 3)
- return 1;
-
- printf("s;@%s@;", argv[1]);
-
- for (p=argv[2]; *p; ++p) {
- if ( *p == ';' )
- putchar('\\');
- putchar(*p);
- }
-
- puts(";g");
- return 0;
-}
-EOF
-
- if $AC_CC -o config.sed ngc$$.c; then
- rm -f ngc$$.c
- __config_files="$__config_files config.sed"
- else
- rm -f ngc$$.c
- AC_FAIL "Cannot generate config.sed helper program"
- fi
-}
-
#
# AC_SUB writes a substitution into config.sub
AC_SUB() {
@@ -1788,8 +1742,7 @@ AC_SUB() {
echo "target=$_target, rest=$*"
- __ac_config_sed
- ./config.sed "$_target" "$*" >> "$__cwd"/config.sub
+ config.sed "$_target" "$*" >> "$__cwd"/config.sub
}
#
# AC_TEXT writes arbitrary text into config.h

View File

@@ -0,0 +1,47 @@
final: prev: let
config-sed = prev.buildPackages.stdenv.mkDerivation {
name = "orc-discount-config-sed";
src = ./config-sed.c;
dontUnpack = true;
buildPhase = ''
$CC -o config.sed $src
'';
installPhase = ''
mkdir -p $out/bin
chmod +x ./config.sed
mv config.sed $out/bin
'';
};
in prev.discount.overrideAttrs (old: let
patches = [
./config-sed.patch
./make-fix.patch
] ++ old.patches;
orc-tools = prev.buildPackages.stdenv.mkDerivation {
name = "orc-discount-tools";
src = old.src;
inherit patches;
configureScript = old.configureScript;
configureFlags = old.configureFlags;
buildPhase = ''
$CC -o mktags mktags.c
$CC -I ./ -o branch tools/branch.c
'';
installPhase = ''
mkdir -p $out/bin
mv mktags $out/bin
mv branch $out/bin
'';
};
in {
# ./configure does not support autoconf-style --build=/--host=.
configurePlatforms = [ ];
depsBuildBuild = [
config-sed
orc-tools
prev.buildPackages.coreutils
];
nativeBuildInputs = [
];
inherit patches;
})

View File

@@ -0,0 +1,58 @@
diff --git a/Makefile.in b/Makefile.in
index 085fbd5..e59d769 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,7 +29,7 @@ OBJS=mkdio.o markdown.o dumptree.o generate.o \
xml.o Csio.o xmlpage.o basename.o emmatch.o \
github_flavoured.o setup.o tags.o html5.o \
@AMALLOC@ @H1TITLE@ flags.o
-TESTFRAMEWORK=echo cols branch pandoc_headers
+TESTFRAMEWORK=echo cols pandoc_headers
# modules that markdown, makepage, mkd2html, &tc use
COMMON=pgm_options.o gethopt.o notspecial.o
@@ -84,19 +84,16 @@ $(DESTDIR)$(LIBDIR):
@MK_PKGCONFIG@$(DESTDIR)$(PKGDIR):
@MK_PKGCONFIG@ $(INSTALL_DIR) $(DESTDIR)$(PKGDIR)
-version.o: version.c VERSION branch
- $(BUILD) -DBRANCH=`./branch` -DVERSION=\"`cat VERSION`\" -c version.c
+version.o: version.c VERSION
+ $(BUILD) -DBRANCH=`branch` -DVERSION=\"`cat VERSION`\" -c version.c
VERSION:
@true
tags.o: tags.c cstring.h tags.h blocktags
-blocktags: mktags
- ./mktags > blocktags
-
-mktags: mktags.o
- $(LINK) -o mktags mktags.o
+blocktags:
+ mktags > blocktags
# example programs
@THEME@theme: theme.o $(COMMON) $(MKDLIB) mkdio.h
@@ -143,11 +140,6 @@ pandoc_headers.o: tools/pandoc_headers.c config.h
pandoc_headers: pandoc_headers.o $(COMMON) $(MKDLIB)
$(LINK) -o pandoc_headers pandoc_headers.o $(COMMON) -lmarkdown
-branch.o: tools/branch.c config.h
- $(BUILD) -c -o branch.o tools/branch.c
-branch: branch.o
- $(LINK) -o branch branch.o
-
cols.o: tools/cols.c config.h
$(BUILD) -c -o cols.o tools/cols.c
cols: cols.o
@@ -163,7 +155,7 @@ clean:
rm -f $(MKDLIB) `./librarian.sh files $(MKDLIB) VERSION`
distclean spotless: clean
- @DISTCLEAN@ @GENERATED_FILES@ @CONFIGURE_FILES@ ./mktags ./blocktags
+ @DISTCLEAN@ @GENERATED_FILES@ @CONFIGURE_FILES@ ./blocktags
Csio.o: Csio.c cstring.h amalloc.h config.h markdown.h
amalloc.o: amalloc.c

View File

@@ -0,0 +1,13 @@
diff --git a/configure.inc b/configure.inc
index fd0c9ba..7ea98e6 100755
--- a/configure.inc
+++ b/configure.inc
@@ -1830,7 +1830,7 @@ AC_QUIET() {
}
-AC_TR=`acLookFor tr`
+AC_TR=`which tr`
if [ "$AC_TR" ]; then
# try posix-style tr
ABC=`echo abc | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`

View File

@@ -0,0 +1,19 @@
(final: prev:
prev.fwupd-efi.overrideAttrs (old: {
mesonFlags = old.mesonFlags ++ [
# Use this instead of patch, however it points to proper binary
"-Defi-cc=${prev.stdenv.cc.targetPrefix}cc"
];
preBuild = ''
cp ${prev.gnu-efi}/lib/*.lds ../efi/lds
'';
patches = [
(prev.fetchurl {
url = "https://github.com/fwupd/fwupd-efi/commit/986a6e3beee6b951ca3622f47ed991e0e11c065c.diff";
hash = "sha256-UKerVzSn28QSoca6m2igVM6ai8i3B2jyB52B6e/HV5A=";
})
# ./efi-meson.patch
];
})
)

View File

@@ -0,0 +1,13 @@
diff --git a/efi/meson.build b/efi/meson.build
index 936ba3c..53687b1 100644
--- a/efi/meson.build
+++ b/efi/meson.build
@@ -1,7 +1,7 @@
generate_sbat = find_program('generate_sbat.py', native: true)
generate_binary = find_program('generate_binary.py', native: true)
-efi_cc = get_option('efi-cc')
+efi_cc = run_command('sh', '-c', 'echo $CC')
efi_ld = get_option('efi-ld')
efi_ldsdir = get_option('efi-ldsdir')
efi_incdir = get_option('efi-includedir')

View File

@@ -0,0 +1,14 @@
diff --git a/meson.build b/meson.build
index 7d59695..b82bcdf 100644
--- a/meson.build
+++ b/meson.build
@@ -31,6 +31,9 @@ elif host_cpu == 'arm'
elif host_cpu == 'aarch64'
EFI_MACHINE_TYPE_NAME = 'aa64'
gnu_efi_arch = 'aarch64'
+elif host_cpu == 'riscv64'
+ EFI_MACHINE_TYPE_NAME = '.'
+ gnu_efi_arch = 'riscv64'
else
error('Unknown host_cpu ' + host_cpu)
endif

View File

@@ -0,0 +1,10 @@
# TODO: gn-unstable needs rev newer than 2021-01-28
# 713a1850957b919c876c924e43ef0ddc4d8a8144 for riscv64 support
final: prev: prev.gn.overrideAttrs (old: {
src = prev.fetchgit {
url = "https://gn.googlesource.com/gn";
rev = "713a1850957b919c876c924e43ef0ddc4d8a8144";
hash = "sha256-yzx7wPp/PEwGg4HZ99YntyHJ384nTVq6fyB6/vOOvOM=";
};
})

View File

@@ -0,0 +1,4 @@
final: prev: prev.gnugrep.overrideAttrs (old: {
doCheck = false; #prev.stdenv.hostPlatform != "riscv64-linux";
})

View File

@@ -0,0 +1,5 @@
final: prev: prev.libdrm.overrideAttrs (old: {
buildInputs = old.buildInputs ++ [
final.libatomic_ops
];
})

View File

@@ -0,0 +1,8 @@
final: prev: prev.live555.overrideAttrs (old: {
preConfigure = (prev.lib.optional (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) ''
sed -e 's/^C_COMPILER.*=.*$/C_COMPILER = $(CC)/g' -i config.*
sed -e 's/^CPLUSPLUS_COMPILER.*=.*$/CPLUSPLUS_COMPILER = $(CXX)/g' -i config.*
sed -e 's/^LINK.*=.*$/LINK = $(CXX) -o/g' -i config.*
sed -e 's/^LIBRARY_LINK.*=.*$/LIBRARY_LINK = $(AR) cr /g' -i config.*
'');
})

View File

@@ -0,0 +1,5 @@
final: prev: prev.openfortivpn.overrideAttrs (old: {
configureFlags = old.configureFlags ++ prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
"--disable-proc"
];
})

View File

@@ -0,0 +1,42 @@
final: prev: prev.perl538Packages.Testutf8.overrideAttrs (old: let
perl = final.perl538;
in {
postInstall = prev.lib.optionalString (prev.stdenv.buildPlatform != prev.stdenv.hostPlatform) ''
mkdir -p $out/${perl.libPrefix}/cross_perl/${perl.version}/DBI
cat > $out/${perl.libPrefix}/cross_perl/${perl.version}/DBI.pm <<EOF
package DBI;
BEGIN {
our \$VERSION = "$version";
}
1;
EOF
autodir=$(echo $out/${perl.libPrefix}/${perl.version}/*/auto/DBI)
cat > $out/${perl.libPrefix}/cross_perl/${perl.version}/DBI/DBD.pm <<EOF
package DBI::DBD;
use Exporter ();
use vars qw (@ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(dbd_postamble);
sub dbd_postamble {
return '
# --- This section was generated by DBI::DBD::dbd_postamble()
DBI_INSTARCH_DIR=$autodir
DBI_DRIVER_XST=$autodir/Driver.xst
# The main dependency (technically correct but probably not used)
\$(BASEEXT).c: \$(BASEEXT).xsi
# This dependency is needed since MakeMaker uses the .xs.o rule
\$(BASEEXT)\$(OBJ_EXT): \$(BASEEXT).xsi
\$(BASEEXT).xsi: \$(DBI_DRIVER_XST) $autodir/Driver_xst.h
''\t\$(PERL) -p -e "s/~DRIVER~/\$(BASEEXT)/g" \$(DBI_DRIVER_XST) > \$(BASEEXT).xsi
# ---
';
}
1;
EOF
'';
})

View File

@@ -0,0 +1,11 @@
final: prev: prev.protobuf.overrideAttrs (old: {
# https://github.com/advancedtelematic/aktualizr/issues/1427
# atomics not supported, need either submit PR like suggested bove
# or, for now, use libatomic_ops
postPatch = old.postPatch + ''
sed -i -e 's/set(protobuf_LINK_LIBATOMIC false)/set(protobuf_LINK_LIBATOMIC true)/' CMakeLists.txt
'';
buildInputs = [
prev.libatomic_ops
] ++ old.buildInputs;
})

View File

@@ -0,0 +1,15 @@
final: prev: prev.valgrind.overrideAttrs (old: {
src = prev.fetchFromGitHub {
owner = "petrpavlu";
repo = "valgrind-riscv64";
rev = "71272b252977fe52f03ea4fa8306b457b098cca5";
hash = "sha256-xD84dYSzq9eD35NfnmtI/zONVRjhDAEJkge26yFK034=";
};
outputs = [ "out" ];
patches = [
(prev.fetchpatch {
url = "https://bugsfiles.kde.org/attachment.cgi?id=149173";
sha256 = "sha256-jX9hD4utWRebbXMJYZ5mu9jecvdrNP05E5J+PnKRTyQ=";
})
];
})

View File

@@ -0,0 +1,3 @@
final: prev: prev.vpnc.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [final.perl]);
})

View File

@@ -0,0 +1,7 @@
final: prev: prev.vulkan-tools.overrideAttrs (old: {
cmakeFlags = old.cmakeFlags ++ (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
"-DBUILD_CUBE=OFF"
"-DPKG_CONFIG_EXECUTABLE=${prev.buildPackages.pkg-config}/bin/riscv64-unknown-linux-gnu-pkg-config"
]);
})

View File

@@ -0,0 +1,3 @@
final: prev: prev.cryptsetup.overrideAttrs (old: {
doCheck = false;
})

View File

@@ -0,0 +1,68 @@
(final: prev: let
noCheck = p: p.overrideAttrs (old: {
doCheck = false;
});
in {
valgrind = (import ./valgrind) final prev;
valgrind-light = final.valgrind.override { gdb = null; };
cryptsetup = (import ./cryptsetup) final prev;
libopus = noCheck prev.libopus;
gn = (import ./gn) final prev;
# Test Times out
openexr = noCheck prev.openexr;
ell = noCheck prev.ell;
# Checks timeout:
pixman = noCheck prev.pixman;
# Inspired by: https://github.com/systemd/systemd/issues/12534
# and https://github.com/systemd/systemd/issues/30448
# Seems RISC-V and the like with GCC don't play well with O3
systemd = prev.systemd.overrideAttrs (old: {
# https://github.com/mesonbuild/meson/issues/10487
mesonBuildType = "custom";
mesonFlags = old.mesonFlags ++ [ "-Doptimization=2" ];
});
# See https://github.com/catchorg/Catch2/issues/2808
# Fixed by https://github.com/NixOS/nixpkgs/pull/295243
catch2_3 = prev.catch2_3.overrideAttrs (old: {
preConfigure = (old.preConfigure or "") + ''
export CFLAGS="$CFLAGS -Wno-error=cast-align"
'';
});
# One test times out
json-glib = noCheck prev.json-glib;
# Openh264 doesn't support RISC-V (yet)
# freerdp requires it by default: lets make that not true
freerdp = prev.freerdp.override {
openh264 = null;
};
tracker = noCheck prev.tracker;
openblas = prev.openblas.overrideAttrs (old: {
postPatch = (old.postPatch or "") + ''
sed -i 's/-static//g' Makefile.riscv64
'';
});
python3 = prev.python3.override {
packageOverrides = final-py: prev-py: let
noCheck = p: p.overridePythonAttrs (old: {
doCheck = false;
});
in {
dbus-python = prev-py.dbus-python.overridePythonAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ final.dbus ];
doCheck = false;
});
hypothesis = noCheck prev-py.hypothesis;
h2 = noCheck prev-py.h2;
numpy = prev-py.numpy.overridePythonAttrs (old: {
doCheck = false;
});
# https://github.com/pandas-dev/pandas/pull/50349 <-- This
# but for risc-v
pandas = noCheck prev-py.pandas;
sphinx = noCheck prev-py.sphinx;
#skia-pathops = prev.skia-pathops.overridePythonAttrs (old: {
# patches = old.patches or [] ++ [ ./skia-riscv.patch ];
#});
};
};
})

View File

@@ -0,0 +1,10 @@
# TODO: gn-unstable needs rev newer than 2021-01-28
# 713a1850957b919c876c924e43ef0ddc4d8a8144 for riscv64 support
final: prev: prev.gn.overrideAttrs (old: {
src = prev.fetchgit {
url = "https://gn.googlesource.com/gn";
rev = "713a1850957b919c876c924e43ef0ddc4d8a8144";
hash = "sha256-yzx7wPp/PEwGg4HZ99YntyHJ384nTVq6fyB6/vOOvOM=";
};
})

View File

@@ -0,0 +1,15 @@
final: prev: prev.valgrind.overrideAttrs (old: {
src = prev.fetchFromGitHub {
owner = "petrpavlu";
repo = "valgrind-riscv64";
rev = "71272b252977fe52f03ea4fa8306b457b098cca5";
hash = "sha256-xD84dYSzq9eD35NfnmtI/zONVRjhDAEJkge26yFK034=";
};
outputs = [ "out" ];
patches = [
(prev.fetchpatch {
url = "https://bugsfiles.kde.org/attachment.cgi?id=149173";
sha256 = "sha256-jX9hD4utWRebbXMJYZ5mu9jecvdrNP05E5J+PnKRTyQ=";
})
];
})

Binary file not shown.

View File

@@ -11,7 +11,7 @@
rm -rf "$nix_apps"
mkdir -p "$nix_apps"
find ${config.system.build.applications}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
while read -r src; do
while read src; do
# Spotlight does not recognize symlinks, it will ignore directory we link to the applications folder.
# It does understand MacOS aliases though, a unique filesystem feature. Sadly they cannot be created
# from bash (as far as I know), so we use the oh-so-great Apple Script instead.

View File

@@ -3,7 +3,7 @@ in
{
imports = [
# Install Apps Detactable by Spotlight
# ./app-fix.nix
./app-fix.nix
# Tiling Window Manager
./yabai.nix
# Shortcuts babe, not Automator
@@ -11,12 +11,10 @@ in
];
nix.registry.nixpkgs.flake = inputs.nixpkgs;
nixpkgs.config.allowUnfree = true;
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# nix.package = pkgs.nixUnstable;
nix.settings.auto-optimise-store = false;
nix.settings.trusted-users = [
"root"
"universelaptop"
];
users.users.universelaptop = {
name = "universelaptop";
@@ -42,16 +40,11 @@ in
};
};
home.stateVersion = "22.05";
# TODO: https://nohzafk.github.io/posts/2023-12-18-nix-emacs-treesit-grammars/
# home.file = {
# # tree-sitter subdirectory of the directory specified by user-emacs-directory
# ".config/emacs/.local/cache/tree-sitter".source =
# "${emacs29.treesitGrammars}/lib";
# };
};
};
fonts.packages = with pkgs; [
fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [
julia-mono
bqn386
];
@@ -67,85 +60,8 @@ in
VISUAL = "emacs";
};
nixpkgs.overlays = [
(final: prev: {
skia-aseprite = prev.skia-aseprite.overrideAttrs (old: {
postPatch = (old.postPatch or "") + ''
sed -i -e 's/"-march=armv7-a",//g' gn/skia/BUILD.gn
'';
buildInputs = old.buildInputs ++ [
final.xcbuild
final.darwin.apple_sdk.frameworks.ApplicationServices
];
meta.maintainers = with pkgs.lib.maintainers; [
davidcromp
];
});
aseprite = prev.aseprite.overrideAttrs (old: {
cmakeFlags = [
"-DENABLE_DESKTOP_INTEGRATION=OFF"
"-DENABLE_UPDATER=OFF"
"-DUSE_SHARED_CMARK=ON"
"-DUSE_SHARED_CURL=ON"
"-DUSE_SHARED_FMT=ON"
"-DUSE_SHARED_FREETYPE=ON"
"-DUSE_SHARED_GIFLIB=ON"
"-DUSE_SHARED_HARFBUZZ=ON"
"-DUSE_SHARED_JPEGLIB=ON"
"-DUSE_SHARED_LIBPNG=ON"
"-DPNG_ARM_NEON:STRING=on"
"-DUSE_SHARED_LIBWEBP=ON"
"-DUSE_SHARED_PIXMAN=ON"
"-DUSE_SHARED_TINYXML=ON"
"-DUSE_SHARED_WEBP=ON"
"-DUSE_SHARED_ZLIB=ON"
# Disable libarchive programs.
"-DENABLE_CAT=OFF"
"-DENABLE_CPIO=OFF"
"-DENABLE_TAR=OFF"
# UI backend.
"-DLAF_OS_BACKEND=skia"
"-DLAF_WITH_EXAMPLES=OFF"
"-DSKIA_DIR=${final.skia-aseprite}"
"-DSKIA_LIBRARY_DIR=${final.skia-aseprite}/lib"
"-DSKIA_LIBRARYR=${final.skia-aseprite}/lib/libskia.a"
];
buildInputs = with pkgs; [
cmark
curl
fmt
fontconfig
freetype
giflib
glib
harfbuzzFull
libjpeg
libpng
libwebp
pcre2
pixman
skia-aseprite
tinyxml-2
zlib
# MacOS:
] ++ (with darwin.apple_sdk.frameworks; [
Cocoa
QuickLook
Quartz
]);
hardeningDisable = [
"format" # Darwin Specific
];
meta.broken = false;
});
})
];
environment.systemPackages = (with pkgs; [
me-emacs
svgbob
mac-emacs
(aspellWithDicts (p: with p;[
en
en-computers
@@ -155,7 +71,7 @@ in
texliveFull
wget
#xquartz
xquartz
kitty
btop
@@ -169,12 +85,9 @@ in
tailscale
discord
slack
inkscape
gimp
# aseprite
# TODO: Consider using Yabai??
# Games
prismlauncher
]);
homebrew = {
@@ -192,21 +105,18 @@ in
"bitwarden"
"zoom-for-it-admins"
"libreoffice"
"microsoft-office"
"prismlauncher"
"kicad"
"tailscale"
"godot"
"pixelorama"
"blender"
"inkscape"
"wine-stable"
];
# Apps to install outside of nix for when wanting to test/run
# things that... aren't used by other people who use nix, like
# python apps (which is why poetry is there)
brews = [
"poetry"
"pdm"
"python@3.11"
"python@3.10"
"pygments"
# sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk \
# /Library/Java/JavaVirtualMachines/openjdk.jdk
"openjdk"
@@ -220,5 +130,4 @@ in
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
system.primaryUser = "universelaptop";
}

View File

@@ -1,18 +0,0 @@
(libresprite.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "LibreSprite";
repo = "LibreSprite";
rev = "c99d3666b17ff731824e3eccc79cf3ec48564ad5";
fetchSubmodules = true;
sha256 = "sha256-mdMdHQvl6Mt0oisZ4c/Wk6dvklq3Iyz05brbFxSIaj0=";
};
patches = [];
buildInputs = old.buildInputs ++ (with pkgs; [
libarchive
tinyxml-2
]);
postPatch = ''
sed -i -e 's/if(''${CMAKE_SYSTEM_NAME} MATCHES "Darwin")/if(FALSE)/' CMakeLists.txt
'';
meta.broken = false;
}))

View File

@@ -2,7 +2,7 @@
services.skhd = {
enable = true;
skhdConfig = ''
cmd + shift - e : open '${(pkgs.me-emacs.override {withNativeCompilation = false;})}/Applications/Emacs.app'
cmd + shift - e : open '${pkgs.mac-emacs}/Applications/Emacs.app'
cmd + shift + ctrl - e : kitty -d ~ -1
'';
};

View File

@@ -2,9 +2,9 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ lib, config, pkgs, inputs, ... }: {
{ lib, config, pkgs, nixpkgs, ... }: {
nix.settings.auto-optimise-store = true;
nix.registry.nixpkgs.flake = inputs.nixpkgs;
nix.registry.nixpkgs.flake = nixpkgs;
# Allow user-mode qemu for running riscv64 binaries
# boot.binfmt.emulatedSystems = [ "riscv64-linux" ];
@@ -34,9 +34,6 @@
# ccache, y'know for blenders and whatnots
./ccache.nix
# So we can run riscv 'natively'
./riscv.nix
];
fileSystems."/home/universe/tmp" = {
@@ -57,15 +54,14 @@
networking.useDHCP = false;
networking.interfaces.wlp6s0.useDHCP = true;
# Fixes DNS issue with tailscale: https://github.com/tailscale/tailscale/issues/4254
#services.resolved.enable = true;
networking.resolvconf.enable = true;
services.resolved.enable = true;
sops.secrets.wireless = { };
networking.wireless.secretsFile = config.sops.secrets.wireless.path;
networking.wireless.environmentFile = config.sops.secrets.wireless.path;
networking.wireless.enable = true;
networking.wireless.networks = {
"BELL422".pskRaw = "ext:PSK_HOME";
"@SSID_HOME@".psk = "@PSK_HOME@";
};
hardware.bluetooth.enable = true;

View File

@@ -1,25 +0,0 @@
diff --git a/src/wl_window.c b/src/wl_window.c
index 5b491ff..f54b244 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -2236,16 +2236,16 @@ void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos)
// A Wayland client is not aware of its position, so just warn and leave it
// as (0, 0)
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
- "Wayland: The platform does not provide the window position");
+ fprintf(stderr,
+ "Wayland: The platform does not provide the window position");
}
void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos)
{
// A Wayland client can not set its position, so just warn
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
- "Wayland: The platform does not support setting the window position");
+ fprintf(stderr,
+ "Wayland: The platform does not support setting the window position");
}
void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height)

View File

@@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }: {
imports = [
./audio.nix
./graphics.nix
# ./dwl.nix # Sadly, nVidia seems to be too broken too often on wayland
./dwm.nix
# ./niri.nix
./displaymanager.nix
];
}

View File

@@ -1,5 +1,41 @@
{ ... }: {
{ config, pkgs, lib, ... }: let
empttyConf = pkgs.writeText "emptty-config" ''
TTY_NUMBER=7
WAYLAND_SESSIONS_PATH="${config.services.displayManager.sessionData.desktops}/share/wayland-sessions"
'';
in {
imports = [
./emptty.nix
./dwl.nix
];
services.displayManager = {
enable = true;
execCmd = "${pkgs.emptty}/bin/emptty -d";
};
systemd.services.display-manager = {
enable = true;
path = [pkgs.dwl];
serviceConfig = {
EnvironmentFile = empttyConf;
Type="idle";
TTYPath="/dev/tty7";
TTYReset="yes";
SendSIGHUP="yes";
KillMode="process";
};
};
environment.etc."emptty/conf".source = empttyConf;
services.displayManager.sessionPackages = [ pkgs.dwl ];
security.pam.services = {
emptty.text = ''
auth substack sshd
account include sshd
password substack sshd
session include sshd
'';
};
}

View File

@@ -8,26 +8,13 @@ in {
./wayland.nix
];
services.displayManager.sessionPackages = [ pkgs.dwl ];
#services.gnome.gnome-keyring.enable = lib.mkDefault true;
systemd.packages = [ pkgs.dwl ];
nixpkgs.overlays = [
(final: prev: {
wlroots_0_19 = prev.wlroots_0_18.overrideAttrs (old: {
src = final.fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "wlroots";
repo = "wlroots";
rev = "d305934ebe6852785a1f425ee96861f0b7280d76"; # 0.19-prev # 25-01-25
hash = "sha256-NnPSC5p/phTFe+nWp9vl8LUbmBO/RXSSUuDZ2boucXY=";
};
});
dwl = (prev.dwl.override { wlroots = final.wlroots_0_19; }).overrideAttrs (old: let
dwl = prev.dwl.overrideAttrs (old: let
dwl-patches = pkgs.fetchgit {
url = "https://codeberg.org/dwl/dwl-patches.git";
rev = "4a869141fa643d9be792a9aa44a42cf7f7f882ad";
hash = "sha256-xlaK9xMrc+KDNecsyByRIxXmPEZ2dmP4FQ0bMojsyws=";
rev = "7f93815e9c9d50add8493e680b3057ed0cc6e8a0";
hash = "sha256-LK1+WjAlguBvITPyS4oHXW5bNP19WUEfo87GFmyv8Js=";
};
patches = let
dwl-patch = p: "${dwl-patches}/patches/${p}/${p}.patch";
@@ -38,18 +25,18 @@ in {
(dwl-patch "autostart")
];
in {
version = "21-09-2024";
version = "10-05-2024";
src = final.fetchFromGitea {
domain = "codeberg.org";
owner = "dwl";
repo = "dwl";
rev = "d1c2f434983562bd7d2ace15ab0c05155be603bc";
hash = "sha256-SpfjQfzvbpDiihziyKGPoBwvp3evgCQQhhjldAE/MwY=";
rev = "9825c26cdd5dfed34022b77a8936c5d8f485e134";
hash = "sha256-p7BhCbCduMNTEK5DYNGBYXf+9WU6WlRvR9VdOuSTrVU=";
};
patches = (old.patches or []) ++ patches;
postPatch = (old.postPatch or "") + ''
postPatch = ''
export termcmd=${pkgs.foot}/bin/foot
export editcmd=${launch_emacs}
export menucmd=${pkgs.fuzzel}/bin/fuzzel
@@ -80,33 +67,25 @@ in {
QT_QPA_PLATFORM="wayland-egl";
QT_WAYLAND_DISABLE_WINDOW_DECORATIONS="1";
__JAVA_AWT_WM_NONREPARENTING=1;
# Bug with Wayland: Fixed in 23.1
# Causes firefox & thunderbird to crash
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646/diffs?commit_id=ee5d2250fd159689aae3f7d632a6226971bea85c
MOZ_ENABLE_WAYLAND=0;
GTK_THEME="Adwaita-dark";
};
xdg.portal = {
enable = lib.mkDefault true;
configPackages = [ pkgs.dwl ];
# Recommended by upstream, required for screencast support
# https://github.com/YaLTeR/niri/wiki/Important-Software#portals
extraPortals = [
pkgs.xdg-desktop-portal-gnome
pkgs.xdg-desktop-portal-gtk
];
wlr.enable = true;
xdg.portal.wlr = {
enable = true;
settings = {
screencast = {
output_name = "DP-2";
max_fps = 30;
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
};
};
};
security = {
polkit.enable = true;
pam.services.swaylock = { };
};
services.graphical-desktop.enable = true;
services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true;
environment.systemPackages = with pkgs; [
dwl
waybar

View File

@@ -1,474 +0,0 @@
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "Liberation Mono:pixelsize=24:antialias=true:autohint=true";
static int borderpx = 2;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
/* alt screens */
int allowaltscreen = 1;
/* allow certain non-interactive (insecure) window operations such as:
setting the clipboard text */
int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 2;
static double maxlatency = 33;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0;
/* default TERM value */
char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"black",
"red3",
"green3",
"yellow3",
"blue2",
"magenta3",
"cyan3",
"gray90",
/* 8 bright colors */
"gray50",
"red",
"green",
"yellow",
"#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"gray90", /* default foreground colour */
"black", /* default background colour */
};
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
/*
* Default shape of cursor
* 2: Block ("█")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("☃")
*/
static unsigned int cursorshape = 2;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80;
static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7;
static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ TERMMOD|ShiftMask, XK_KP_Subtract, zoom, {.f = -1} },
{ TERMMOD|ShiftMask, XK_KP_Equal, zoom, {.f = +1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
};
/*
* Special keys (change & recompile st.info accordingly)
*
* Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = {
/* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
};
/*
* Selection types' masks.
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress.
* ButtonRelease and MotionNotify.
* If no match is found, regular selection is used.
*/
static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask,
};
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@@ -1,64 +0,0 @@
{ config, pkgs, lib, ... }: {
nixpkgs.overlays = [
(final: prev: {
st = prev.st.override {
conf = builtins.readFile (pkgs.replaceVars ./dwm/st-config.def.h {});
};
})
];
services.xserver.windowManager.dwm = {
enable = true;
package = let
launch_emacs = pkgs.writeScript "emacsclient-or-start" ''
#!${pkgs.bash}/bin/bash
emacsclient --create-frame --alternate-editor=""
'';
in pkgs.dwm.override {
conf = pkgs.replaceVars ./dwm/config.h {
dmenucmd="${pkgs.dmenu}/bin/dmenu_run";
termcmd="${pkgs.st}/bin/st";
editcmd="${launch_emacs}";
playcmd=pkgs.writeScript "playerctl-play-pause" ''
#!${pkgs.bash}/bin/bash
${pkgs.playerctl}/bin/playerctl play-pause
'';
scrncmd=pkgs.writeScript "screenshot-region" ''
#!${pkgs.bash}/bin/bash
${pkgs.maim}/bin/maim -o -s | ${pkgs.xclip}/bin/xclip -sel clip -t image/png
'';
};
patches = [
./dwm/fullscreen.patch
];
};
};
services.xserver.enable = true;
# services.xserver.xrandrHeads should work, but alas
services.xserver.displayManager.setupCommands = ''
${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --auto --output DP-2 --auto --right-of DP-4 --primary --output HDMI-0 --auto --right-of DP-2;
'';
services.xserver.displayManager.lightdm = {
enable = true;
background = "#000000";
};
services.xserver.config = lib.mkAfter ''
Section "InputClass"
Identifier "joystick catchall"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
Option "StartKeysEnabled" "False"
Option "StartMouseEnabled" "False"
EndSection
'';
environment.sessionVariables = {
GTK_THEME="Adwaita-dark";
};
environment.systemPackages = with pkgs; [
dmenu
xclip
pwvucontrol
st
];
}

View File

@@ -1,124 +0,0 @@
#include <X11/XF86keysym.h>
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
/* { "Gimp", NULL, NULL, 0, 1, -1 }, */
{ "Firefox", NULL, NULL, 1 << 2, 0, -1 },
};
/* layout(s) */
static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "@dmenucmd@", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "@termcmd@", NULL };
static const char *editcmd[] = { "@editcmd@", NULL };
static const char *playcmd[] = { "@playcmd@", NULL };
static const char *scrncmd[] = { "@scrncmd@", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_r, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = editcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_z, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscreen, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_Print, spawn, {.v = scrncmd } },
{ 0, XF86XK_AudioPlay, spawn, {.v = playcmd } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static const Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

View File

@@ -1,25 +0,0 @@
diff --git a/dwm.c b/dwm.c
index f1d86b2..17b595a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -211,6 +211,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
+static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus);
@@ -1735,6 +1736,12 @@ togglefloating(const Arg *arg)
arrange(selmon);
}
+void togglefullscreen(const Arg *arg)
+{
+ if(selmon->sel)
+ setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
+}
+
void
toggletag(const Arg *arg)
{

View File

@@ -1,474 +0,0 @@
/* See LICENSE file for copyright and license details. */
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "Liberation Mono:pixelsize=24:antialias=true:autohint=true";
static int borderpx = 2;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
static float cwscale = 1.0;
static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */
static unsigned int doubleclicktimeout = 300;
static unsigned int tripleclicktimeout = 600;
/* alt screens */
int allowaltscreen = 1;
/* allow certain non-interactive (insecure) window operations such as:
setting the clipboard text */
int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 2;
static double maxlatency = 33;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0;
/* default TERM value */
char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
"black",
"red3",
"green3",
"yellow3",
"blue2",
"magenta3",
"cyan3",
"gray90",
/* 8 bright colors */
"gray50",
"red",
"green",
"yellow",
"#5c5cff",
"magenta",
"cyan",
"white",
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#cccccc",
"#555555",
"gray90", /* default foreground colour */
"black", /* default background colour */
};
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
/*
* Default shape of cursor
* 2: Block ("█")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("☃")
*/
static unsigned int cursorshape = 2;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80;
static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7;
static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};
/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (ControlMask|ShiftMask)
static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ ControlMask|ShiftMask, XK_KP_Subtract, zoom, {.f = -1} },
{ ControlMask|ShiftMask, XK_KP_Equal, zoom, {.f = +1} },
{ ControlMask, XK_Home, zoomreset, {.f = 0} },
{ ControlMask|ShiftMask, XK_C, clipcopy, {.i = 0} },
{ ControlMask|ShiftMask, XK_V, clippaste, {.i = 0} },
{ ControlMask, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
};
/*
* Special keys (change & recompile st.info accordingly)
*
* Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = {
/* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
{ XK_Insert, ControlMask, "\033[L", -1, 0},
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
{ XK_Delete, ControlMask, "\033[M", -1, 0},
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0},
{ XK_Delete, ShiftMask, "\033[2K", -1, 0},
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0},
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0},
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0},
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0},
{ XK_Home, ShiftMask, "\033[2J", 0, -1},
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1},
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
{ XK_End, ControlMask, "\033[J", -1, 0},
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
{ XK_End, ShiftMask, "\033[K", -1, 0},
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
};
/*
* Selection types' masks.
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress.
* ButtonRelease and MotionNotify.
* If no match is found, regular selection is used.
*/
static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask,
};
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
"`abcdefghijklmnopqrstuvwxyz{|}~";

View File

@@ -1,33 +0,0 @@
{ config, pkgs, lib, ... }: let
empttyConf = pkgs.writeText "emptty-config" ''
TTY_NUMBER=7
WAYLAND_SESSIONS_PATH="${config.services.displayManager.sessionData.desktops}/share/wayland-sessions"
'';
in {
services.displayManager = {
enable = true;
execCmd = "${pkgs.emptty}/bin/emptty -d";
};
systemd.services.display-manager = {
enable = true;
path = [pkgs.dwl];
serviceConfig = {
EnvironmentFile = empttyConf;
Type="idle";
TTYPath="/dev/tty7";
TTYReset="yes";
SendSIGHUP="yes";
KillMode="process";
};
};
security.pam.services = {
emptty.text = ''
auth substack sshd
account include sshd
password substack sshd
session include sshd
'';
};
}

View File

@@ -1,5 +0,0 @@
{ config, pkgs, lib, ... }: {
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
}

View File

@@ -1,29 +0,0 @@
{ config, pkgs, lib, ... }: {
hardware = {
graphics.enable = true;
graphics.enable32Bit = true;
nvidia = {
#modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
nvidiaSettings = true;
open = true;
# package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta;
#package = let
# rcu_patch = pkgs.fetchpatch {
# url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch";
# hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg=";
# };
#in config.boot.kernelPackages.nvidiaPackages.mkDriver {
# version = "535.154.05";
# sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg=";
# sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k=";
# openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo=";
# settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10=";
# persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE=";
# patches = [ rcu_patch ];
#};
};
};
}

View File

@@ -1,106 +0,0 @@
{ config, pkgs, lib, ... }: let
launch_emacs = pkgs.writeScript "emacsclient-or-start" ''
#!${pkgs.bash}/bin/bash
emacsclient --create-frame --alternate-editor=""
'';
in {
imports = [
./wayland.nix
];
services.displayManager.sessionPackages = [ pkgs.dwl ];
#services.gnome.gnome-keyring.enable = lib.mkDefault true;
systemd.packages = [ pkgs.dwl ];
nixpkgs.overlays = [
(final: prev: {
wlroots_0_19 = prev.wlroots_0_18.overrideAttrs (old: {
src = final.fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "wlroots";
repo = "wlroots";
rev = "d305934ebe6852785a1f425ee96861f0b7280d76"; # 0.19-prev # 25-01-25
hash = "sha256-NnPSC5p/phTFe+nWp9vl8LUbmBO/RXSSUuDZ2boucXY=";
};
});
dwl = (prev.dwl.override { wlroots = final.wlroots_0_19; }).overrideAttrs (old: let
dwl-patches = pkgs.fetchgit {
url = "https://codeberg.org/dwl/dwl-patches.git";
rev = "4a869141fa643d9be792a9aa44a42cf7f7f882ad";
hash = "sha256-xlaK9xMrc+KDNecsyByRIxXmPEZ2dmP4FQ0bMojsyws=";
};
patches = let
dwl-patch = p: "${dwl-patches}/patches/${p}/${p}.patch";
in [
(dwl-patch "ipc")
(dwl-patch "restore-monitor")
(dwl-patch "regexrules")
(dwl-patch "autostart")
];
in {
version = "21-09-2024";
src = final.fetchFromGitea {
domain = "codeberg.org";
owner = "dwl";
repo = "dwl";
rev = "d1c2f434983562bd7d2ace15ab0c05155be603bc";
hash = "sha256-SpfjQfzvbpDiihziyKGPoBwvp3evgCQQhhjldAE/MwY=";
};
patches = (old.patches or []) ++ patches;
postPatch = (old.postPatch or "") + ''
export termcmd=${pkgs.foot}/bin/foot
export editcmd=${launch_emacs}
export menucmd=${pkgs.fuzzel}/bin/fuzzel
export barcmd=${pkgs.waybar}/bin/waybar
export playcmd=${pkgs.writeScript "playerctl-play-pause" ''
#!${pkgs.bash}/bin/bash
${pkgs.playerctl}/bin/playerctl play-pause
''}
export scrncmd=${pkgs.writeScript "screenshot-region" ''
#!${pkgs.bash}/bin/bash
${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - - | ${pkgs.wl-clipboard}/bin/wl-copy
''}
substituteAll ${./dwl/config.def.h} ./config.def.h
'';
postInstall = ''
chmod ugo+x $out/share/wayland-sessions/dwl.desktop
'';
passthru.providedSessions = ["dwl"];
});
})
];
security = {
polkit.enable = true;
pam.services.swaylock = { };
};
services.graphical-desktop.enable = true;
services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true;
environment.systemPackages = with pkgs; [
dwl
waybar
foot
pwvucontrol
];
}
{ config, pkgs, lib, ... }: {
programs.niri.enable = true;
environment.sessionVariables = {
# Breaks WebCord
# NIXOS_OZONE_WL=1;
WLR_NO_HARDWARE_CURSORS=1;
SDL_VIDEODRIVER="wayland";
QT_QPA_PLATFORM="wayland-egl";
QT_WAYLAND_DISABLE_WINDOW_DECORATIONS="1";
__JAVA_AWT_WM_NONREPARENTING=1;
GTK_THEME="Adwaita-dark";
};
}

View File

@@ -1,16 +0,0 @@
diff --git a/UI/window-projector.cpp b/UI/window-projector.cpp
index e61f23182..a405e9f17 100644
--- a/UI/window-projector.cpp
+++ b/UI/window-projector.cpp
@@ -37,11 +37,6 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
// can skip it
windowHandle()->setProperty("isOBSProjectorWindow", true);
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
- // Prevents resizing of projector windows
- setAttribute(Qt::WA_PaintOnScreen, false);
-#endif
-
type = type_;
#ifdef __APPLE__
setWindowIcon(

View File

@@ -1,22 +0,0 @@
{ config, pkgs, lib, ... }: {
imports = [
./wayland.nix
./sddm.nix
];
#services.xserver.displayManager.lightdm.enable = true;
# nVidia is broken with 6.12 currently
# boot.kernelPackages = pkgs.linuxPackages_6_11;
services.xserver.enable = true;
services.desktopManager.plasma6.enable = true;
environment.plasma6.excludePackages = with pkgs.kdePackages; [
];
qt = {
enable = true;
platformTheme = "gnome";
style = "adwaita-dark";
};
}

View File

@@ -1,5 +0,0 @@
{ config, pkgs, lib, ... }: {
services.xserver.enable = true;
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
}

View File

@@ -1,34 +1,38 @@
{ config, pkgs, lib, ... }: {
nixpkgs.overlays = [
(final: prev: let
patches-src = pkgs.fetchFromGitHub {
owner = "BoyOrigin";
repo = "glfw-wayland";
rev = "2024-03-07";
hash = "sha256-kvWP34rOD4HSTvnKb33nvVquTGZoqP8/l+8XQ0h3b7Y=";
};
patch' = p: "${patches-src}/patches/${p}.patch";
in {
glfw3-minecraft = prev.glfw3-minecraft.overrideAttrs (old: {
patches = [ (builtins.head old.patches) ] ++ [
(patch' "0001-Key-Modifiers-Fix")
(patch' "0002-Fix-duplicate-pointer-scroll-events")
(patch' "0003-Implement-glfwSetCursorPosWayland")
(patch' "0004-Fix-Window-size-on-unset-fullscreen")
(patch' "0005-Avoid-error-on-startup")
./0006-DontCrashWindowPos.patch
];
});
# Wayland support
hardware = {
opengl.enable = true;
opengl.driSupport = true;
opengl.driSupport32Bit = true;
obs-studio = prev.obs-studio.overrideAttrs (old: {
patches = (old.patches or []) ++ [
./obs-wayland-window-projection.patch
];
});
})
];
nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
nvidiaSettings = true;
open = false;
package = let
rcu_patch = pkgs.fetchpatch {
url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch";
hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg=";
};
in config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "535.154.05";
sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg=";
sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k=";
openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo=";
settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10=";
persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE=";
patches = [ rcu_patch ];
};
};
};
programs.xwayland.enable = true;
environment.systemPackages = with pkgs; [
# Minecraft can behave oddly on wayland without this
glfw-wayland-minecraft
# Screen mirroring:
wdomirror
];
}

View File

@@ -5,9 +5,41 @@
python-final: python-prev: let
py = python-prev;
in {
opencamlib = py.toPythonModule (pkgs.stdenv.mkDerivation rec {
pname = "opencamlib";
version = "2019.07";
nativeBuildInputs = (with pkgs;[
cmake
git
doxygen
boost
texlive.combined.scheme-full
]);
propagatedNativeBuildInputs = [
py.python
py.boost
py.vtk
];
postPatch = ''
mkdir -p $out/${py.python.sitePackages}/{lib,ocl}
sed -e 's#LIBRARY DESTINATION ''${PYTHON_ARCH_PACKAGES}#LIBRARY DESTINATION '"$out"'/${py.python.sitePackages}#g' -i src/pythonlib/pythonlib.cmake
sed -e 's#DESTINATION ''${PYTHON_SITE_PACKAGES}#DESTINATION '"$out"'/${py.python.sitePackages}#g' -i src/pythonlib/pythonlib.cmake
'';
cmakeFlags = [
"-DVERSION_STRING=2019.07"
"-DBUILD_CXX_LIB=ON"
"-DBUILD_PY_LIB=ON"
"-DUSE_PY_3=ON"
"-DCMAKE_BUILD_TYPE=Release"
];
src = pkgs.fetchFromGitHub {
owner = "aewallin";
repo = "opencamlib";
rev = "2019.07";
sha256 = "1a8pxp1mh8x3bfsb0l97vgxrpk482p7q9jprkd4m9hv69vva2bdz";
};
});
equation = py.buildPythonPackage {
pyproject = true;
build-system = [ py.setuptools ];
pname = "Equation";
version = "1.2.01";
nativeBuildInputs = [
@@ -20,8 +52,6 @@
};
};
morphio = py.toPythonModule ( pkgs.stdenv.mkDerivation rec {
pyproject = true;
build-system = [ py.setuptools ];
pname = "MorphIO";
version = "3.3.4";
nativeBuildInputs = (with pkgs; [
@@ -55,20 +85,20 @@
blender_cuda = prev.blender.override {
cudaSupport = true;
};
# blender = final.blender_cuda.withPackages (p: with p; [
# # OpenCAMLib support
# shapely
# equation
# opencamlib
# # NeuroMorphoVis support
# matplotlib
# seaborn
# pandas
# pillow
# h5py
# morphio
# # TODO add BluePy support?
# ]);
blender = final.blender_cuda.withPackages (p: with p; [
# OpenCAMLib support
shapely
equation
opencamlib
# NeuroMorphoVis support
matplotlib
seaborn
pandas
pillow
h5py
morphio
# TODO add BluePy support?
]);
# Update RX and Aseprite
rx = prev.rx.overrideAttrs (old: {
version = "git";
@@ -84,11 +114,10 @@
environment.systemPackages = with pkgs; [
blender
# GTK theme support (basic) for GTK apps e.g. inkscape
adwaita-icon-theme
gnome.adwaita-icon-theme
rx
aseprite-unfree
pixelorama
gimp
glaxnimate

View File

@@ -1,7 +1,6 @@
{ lib, config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
openscad
freecad
kicad

View File

@@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }: {
{ lib, config, pkgs, nixpkgs, ... }: {
nixpkgs.overlays = [(self: super: rec {
# Discord fix
discord = super.discord.override {
@@ -24,7 +24,9 @@
nextcloud-client
libsForQt5.kdeconnect-kde
discord
vesktop
slack
signal-desktop
zoom-us
anki

View File

@@ -1,15 +1,22 @@
{ lib, config, pkgs, ... }: {
# # For steam
# services.flatpak.enable = true;
# ## Flatpak requires this
# For steam
services.flatpak.enable = true;
## Flatpak requires this
xdg.portal.enable = true;
xdg.portal.wlr.enable = true;
xdg.portal.config.common.default = "*";
# On X11: Steam requires a compositor for BigPicture
programs.steam.enable = true;
# Game compat
programs.gamemode.enable = true;
nixpkgs.overlays = [
(final: prev: {
prismlauncher = prev.prismlauncher.override {
withWaylandGLFW=true;
};
})
];
environment.systemPackages = with pkgs; [
# For Steam
protontricks

View File

@@ -1,6 +1,6 @@
{ lib, config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
emacs
me-emacs
texlive.combined.scheme-full
pandoc
libreoffice-qt

View File

@@ -1,21 +1,15 @@
{ lib, config, pkgs, ... }: let
mypython = let
packageOverrides = final: prev: {
matplotlib = prev.matplotlib.override {enableGtk3 = true;};
};
in pkgs.python3.override {inherit packageOverrides;};
in {
{ lib, config, pkgs, ... }: {
virtualisation = {
podman = {
enable = true;
};
};
environment.systemPackages = with pkgs; [
godot_4
cbqn-replxx
(mypython.withPackages (p: (with p; [
(pkgs.python3.withPackages (p: (with p; [
scipy
numpy
pandas
@@ -24,7 +18,7 @@ in {
beautifulsoup4
tqdm
matplotlib
colour
pyqt5
ipython
python-lsp-server

View File

@@ -9,8 +9,7 @@
htop
btop
xclip
tio
tmux
screen
usbutils
man-pages
man-pages-posix

View File

@@ -1,6 +1,6 @@
{ lib, config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
vlc
ffmpeg-full
ffmpeg_5-full
];
}

Some files were not shown because too many files have changed in this diff Show More