Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dotfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
dotfiles
Commits
b4aa2cbb
Commit
b4aa2cbb
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add reduced base layer for appliances
parent
df960f3d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
layers/base-appliance.nix
+109
-0
109 additions, 0 deletions
layers/base-appliance.nix
with
109 additions
and
0 deletions
layers/base-appliance.nix
0 → 100644
+
109
−
0
View file @
b4aa2cbb
# Basic configuration for appliances
{
pkgs
,
lib
,
isMobileNixos
,
...
}:
with
lib
;
let
root
=
pkgs
.
writeShellScriptBin
"root"
''
if [ -n "$1" ] ; then
TUSER="$1"
else
TUSER="root"
fi
shell="$(getent passwd "$TUSER" 2>/dev/null | { IFS=: read _ _ _ _ _ _ x; echo "$x"; })"
exec machinectl shell --setenv=SHELL="$shell" "$TUSER@" "$shell" --login -i
''
;
in
{
imports
=
[
./ioschedulers.nix
];
nix
.
package
=
pkgs
.
nixFlakes
;
# noop in current nixpkgs
nix
.
extraOptions
=
''
experimental-features = nix-command flakes
''
;
#nix.daemonNiceLevel = 13;
nix
.
daemonCPUSchedPolicy
=
"batch"
;
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system
.
stateVersion
=
mkDefault
"20.09"
;
# Did you read the comment?
# Is it worth to specify this where it is needed instead of configuring it globally? Not sure yet.
nixpkgs
.
config
.
allowUnfree
=
true
;
# Always run the latest kernel
boot
.
kernelPackages
=
mkIf
(
!
isMobileNixos
)
(
mkDefault
pkgs
.
linuxPackages_latest
);
boot
.
tmpOnTmpfs
=
mkDefault
true
;
# schedutil is a modern replacement for ondemand and conservative that is tied to the scheduler
# priority 100 is default; mkDefault is priority 1000; the goal here is to prefer schedutil over the auto-generated cpuFreqGovernor
powerManagement
.
cpuFreqGovernor
=
mkOverride
900
"schedutil"
;
# Restore systemd default
services
.
logind
.
killUserProcesses
=
true
;
time
.
timeZone
=
"Europe/Berlin"
;
# German locale with english messages
i18n
=
{
defaultLocale
=
"de_DE.UTF-8"
;
extraLocaleSettings
=
{
LC_MESSAGES
=
"en_US.UTF-8"
;
};
supportedLocales
=
[
"en_US.UTF-8/UTF-8"
"de_DE.UTF-8/UTF-8"
];
};
console
=
{
font
=
"Lat2-Terminus16"
;
#keyMap = "de-latin1-nodeadkeys";
useXkbConfig
=
true
;
# Gruvbox tty colors
colors
=
[
"000000"
"cc241d"
"98971a"
"d79921"
"458588"
"b16286"
"689d6a"
"a89984"
"928374"
"fb4934"
"b8bb26"
"fabd2f"
"83a598"
"d3869b"
"8ec07c"
"ebdbb2"
];
};
services
.
xserver
=
{
layout
=
"de"
;
xkbModel
=
"pc105"
;
xkbVariant
=
"nodeadkeys"
;
xkbOptions
=
"caps:escape,shift:both_capslock"
;
};
# I like to be able to carry my laptops with the lid closed while they are still running
services
.
logind
.
lidSwitch
=
"ignore"
;
services
.
openssh
.
enable
=
true
;
services
.
openssh
.
passwordAuthentication
=
false
;
programs
.
ssh
.
startAgent
=
true
;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment
.
systemPackages
=
with
pkgs
;
[
root
foot
.
terminfo
tree
htop
ripgrep
fd
];
users
=
{
mutableUsers
=
false
;
defaultUserShell
=
pkgs
.
zsh
;
users
.
root
=
{
passwordFile
=
"/etc/secrets/passwords/root"
;
};
users
.
jens
=
{
uid
=
1000
;
isNormalUser
=
true
;
passwordFile
=
"/etc/secrets/passwords/jens"
;
extraGroups
=
[
"wheel"
"audio"
"dialout"
"networkmanager"
];
dotfiles
.
profiles
=
[
"base"
];
};
};
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment