add new user

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-13 23:14:04 +03:00
parent af68c8afdd
commit 4d396b7fed
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
8 changed files with 83 additions and 2 deletions

Binary file not shown.

View File

@ -9,6 +9,7 @@ in
extraModules = [
../users/jan
../users/nas
];
extraHomeModule = { ... }: {

View File

@ -41,7 +41,8 @@
networkmanager.enable = true;
};
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "cnijfilter2" ];
local.nix.allowUnfreePackages = [ "cnijfilter2" ];
services = {
avahi = {
enable = true;

View File

@ -1,6 +1,9 @@
{ lib, config, ... }:
let cfg = config.local.nix; in
let
inherit (builtins) elem;
cfg = config.local.nix;
in
{
options.local.nix = with lib; {
enableMyRegistry = mkOption {
@ -8,9 +11,17 @@ let cfg = config.local.nix; in
default = false;
description = "Enable my custom nix registry";
};
allowUnfreePackages = mkOption {
type = types.listOf types.string;
default = [ ];
};
};
config = {
nixpkgs.config.allowUnfreePredicate = lib.mkIf
(cfg.allowUnfreePackages != [ ])
(pkg: elem (lib.getName pkg) cfg.allowUnfreePackages);
nix = {
settings = {
auto-optimise-store = true;

5
notes/users.md Normal file
View File

@ -0,0 +1,5 @@
# How create a password
```sh
mkpasswd -m sha-512
```

Binary file not shown.

29
users/nas/default.nix Normal file
View File

@ -0,0 +1,29 @@
{ config, pkgs, lib, inputs, extraHomeModule ? null, ... }:
{
nixpkgs.overlays = lib.mkAfter [
inputs.wired.overlays.default
];
local.nix.allowUnfreePackages = [ "skypeforlinux" ];
programs.zsh.enable = true;
users.users.nas = {
isNormalUser = true;
shell = pkgs.zsh;
passwordFile = config.age.secrets.users-nas-passfile.path;
};
home-manager.users.nas = { lib, ... }: {
imports = [
inputs.wired.homeManagerModules.default
./home.nix
extraHomeModule
];
home.stateVersion = config.system.stateVersion;
};
age.secrets.users-nas-passfile.file = ../../secrets/users-nas-passfile.age;
}

34
users/nas/home.nix Normal file
View File

@ -0,0 +1,34 @@
{ config, lib, pkgs, ... }:
{
imports = [
../modules/window_manager
../modules/terminal.nix
../modules/shell.nix
../modules/notifications
../modules/themes
../modules/themes/catppuccin/frappe.nix
];
xdg.enable = true;
home.keyboard = {
model = "pc105";
layout = "us,ru";
options = [ "grp:win_space_toggle" ];
};
home.packages = with pkgs; [
skypeforlinux
kotatogram-desktop
libreoffice
image-roll
# browser
(firefox.override {
extraNativeMessagingHosts = [ passff-host ];
})
];
}