Limit graphical programs by hostname

old-yadm
earnest ma 2021-08-14 13:36:11 -04:00
parent 7d1d1388b4
commit 533da03db0
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
3 changed files with 49 additions and 12 deletions

View File

@ -0,0 +1,20 @@
{ pkgs, ... }:
let
pkgsUnstable = import <nixpkgs-unstable> {};
in
{
home.packages = with pkgs; [
authy
barrier
pkgsUnstable.discord
google-chrome
todoist-electron
pkgsUnstable.zoom-us
pkgsUnstable.logseq
sublime-music
alacritty
];
}

View File

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
inherit (lib) optionals;
hostName = import ./hostname.nix lib;
# Be able to use unstable packages
pkgsUnstable = import <nixpkgs-unstable> {};
@ -10,14 +12,12 @@ in
home.username = "earne";
home.homeDirectory = "/home/earne";
home.packages = with pkgs; [
authy # non-free
barrier
pkgsUnstable.discord # non-free
google-chrome # non-free
todoist-electron # non-free
pkgsUnstable.zoom-us # non-free
imports =
(optionals (hostName == "tycho") [
./graphical.nix
]);
home.packages = with pkgs; [
# Doom Emacs + dependencies
pkgsUnstable.fd
pkgsUnstable.ripgrep
@ -27,10 +27,6 @@ in
isync
khard
pkgsUnstable.logseq
sublime-music
alacritty
gitFull
git-extras
ghq

View File

@ -0,0 +1,21 @@
lib:
let
inherit (builtins) currentSystem;
inherit (lib) maybeEnv fileContents;
inherit (lib.systems.elaborate { system = currentSystem; }) isLinux isDarwin;
in
maybeEnv "HOST" (fileContents (
if !isDarwin then
/etc/hostname
else
derivation {
name = "hostname";
system = currentSystem;
builder = "/bin/sh";
args = [ "-c" "/usr/sbin/scutil --get LocalHostName > $out" ];
}
))